Deploy CodeIgniter Php app on heroku - php

I am trying to deploy a php application having CodeIgniter as a framework in heroku.
I followed the steps here until the "Process and dyno tuning" part and managed to deploy my application. The first page works fine, but that's all. For any other page with codeigniter links(/index.php/home/link/ for the home controller, link action) I try to access, the server renders me the same first page. I thought that CI requires some of heroku extensions but here it says it only needs php. Do you happen to know what extensions do i have to provide?
The link to the website is this, and a test url should be this

This is defiantly a URI issue, Please try switching $config['uri_protocol']
from AUTO to any of the available modes until you get it fixed.
If you need a fast fix for this, just add ? for your index.php urls so it will be like this
index.php?/locations/get
but fixing this through the 'uri_protocol' thing is better.

Related

Laravel app downloading all assets again on every route request

I have a strange error in my Laravel(5.6)/app. Whenever there is any route request in the app, all css, js, bootstrap and icons files reload all over again in the browser. I'm debugging this app from last 2 days. And I have no clue what's going on.
I worked on this project a few days ago and it was working fine then I started working on some other project and after a couple of days when I worked again on this project to add some new features, it is behaving like this. Whenever I request any route in the app, all the assets download and load again in the browser. I didn't provide any code sample here because I don't know where the error might be.
If there have been an error in some particular file then that particular route would have behave that way. But all routes reload all the assets all over again. So I just want your opinion is this ever happens to you and how should I tackle it?
If you wanna recreate this project then here is the GitHub link. Git Repo . Recreating this project is very easy. Just create a database. run migrations and then seed the database. For sass and js ,run 'npm run dev' if needed.
Update: Solution to this problem is, don't use buit-in server of laravel, it sucks. Use any php development stack like xampp, wamp etc. and it will work fine.

Problems when moving Symfony3 app from dev to production server

I've created a web application using Symfony 3. In the development environment, I always use Symfony's built-in server and just use the command "php bin/console server:run". The app can then be accessed via "localhost:8000".
I've also defined routes using annotations in Controllers such as "/", "/about" etc. These pages can be accessed via "localhost:8000/" and "localhost:8000/about". Other links on the page that point to routes like "/contact" or "/users/1" also work perfectly. They will link to "localhost:8000/contact" and "localhost:8000/users/1".
Now, I move my application to the production server. On the production server, Apache2 is installed and some other people have developed Symfony applications on it. Their apps can be accessed via url like "example.com/apps/app1/web/app_dev.php" and the links on their apps have been pre-appended with "example.com/apps/app1/web/app_dev.php" automatically. So when the user clicks a button that links to "/contact", the link will direct to "example.com/apps/app1/web/app_dev.php/contact".
Now, when I move my application named "app2" under the "example.com/apps/" directory, I can visit "example.com/apps/app2/web/app_dev.php" without any configuration and see my homepage perfectly. Apache can automatically pick up my code. However all the links on the homepage will direct to "example.com/contact" instead of "example.com/apps/app2/web/app_dev.php/contact".
Can anyone help me with this? I'm pretty new with Symfony and Apache.
Or perhaps I've done the migration from dev to production environment in a totally wrong way? Any new ideas or proper way to move Symfony3 application to production server?
Thanks a lot!
Do you have apache configured correctly? You may need to have a virtualhost configuration added to the server. You can find out about it on the Symfony site for the specifics.
I finally solved the issue. I should use href="{{ path('about') }}" instead of href="/about" in all twig templates. Thanks everybody!

Laravel 4 - Local to Staging 404 issue

I hope that this isn't too broad a question but I have been developing a site locally for a month or so and am ready to put it up on my staging server. The deployment all went smoothly after a little issue installing Mcrypt but all is good now, except for in my staging environment I get a 404 on every route.
They way my application is structured is I have folder in app that contains each of my modules, each module (Users, Auth, Teams etc.) each have their own routes.php file aswell as controllers/models/repositories etc.
If I access the site using say /login I recieve a 404, however, If i was to quickly create that route in the main routes.php file in app/ it works which is leading me to believe that for some reason the server isn't loading the individual modules files.
Can you give me a hand narrowing it down, what sort things should I look at etc?
Thanks in advance.
Ok so I found out the issue.
For some reason my local (homestead) environment wasn't too bothered about case sensitivity, however, my staging server was. A few tweaks and I am up and running, cheers for the ideas though :)

Move Laravel project to another system

I tried to move my laravel 4.1 project from my office system to my personal laptop and I have tried it using various methods:
1) git and bitbucket
2) zipped whole folder and copy
3) using composer install/update on laptop directory to update my dependencies
Neither of the above has worked for me.
I do see my landing page but on clicking any link, it shows:
Not Found
The requested URL was not found on this server.
Seems like some routing error but I do see my index page. Thanks in advance.
It must be a problem with the url rewriting on your system . make sure you fix your htaccess/nginx directives . and also make sure configurations such as mod_rewrite is enabled .
In future try using laravel homestead , so that you have consistent environment across various workstations. It's the recommended way of working using laravel.

Deploy PHP website on Heroku

I have got heroku up and running just now. Not sure how to use the PostgreSQL and how to deploy my website though. It is a few php files. But they php files don't open they are just blank so I guess it is never leaving the index.php
Do i need to include or list all my php files in the default index.php file?
Also with the database i created one and it is in the dashboard listed under apps so now can I connect to it normally or is there more stuff to configure?
Would love some video tutorials showing how to deploy small database driven websites written in PHP to heroku.
Any help is great! Cheers guys :)
If you want to use postgresql database with your website on Heroku, you need this add-on. To set it up read this https://devcenter.heroku.com/articles/heroku-postgresql post.
As for PHP, you seem new to it. To include a file you need to use either require or include.
You can look at this video, for basic deployment of PHP on Heroku.

Categories