I'm getting a 500 error in Heroku trying to launch a staging Codeigniter 3.x project (for the first time). I can't seem to get any better logs than that.
I am using the heroku-php-apache2 buildpack. PHP version is 5.6.x
However, through debugging I can see it is properly setting the root directory as public_html, it is loading the index.php in the root directory, it is loading the config.php and database.php, and it is loading the routes.php.
In my routes.php I have: $route['default_controller'] = "home";
When I go to the homepage, the root, I'm getting a 500 error and it is not loading the home/index controller method like it is supposed to. When I reference a css file, such as https://staging-app/css/grid.css, it does load that so I know the directories are being accessed properly.
In case needed, my .htaccess is
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} !business-loan-tips.*
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
Although, it seems to load the same with or without it.
My composer.json is empty except for '{}'
And my Procfile just has:
web: vendor/bin/heroku-php-apache2 public_html/
Any ideas on where I could be going wrong to get a 500 error or how I can track it down better?
EDIT: I does properly hit the database. I just can't get my controllers to hit.
The reason I was having such trouble is the logging wasn't working properly. As it turns out, Heroku's docs are out of date for logging with Codeigniter 3.x. Moving from CI 2.x to CI 3.x, they moved the Log.php out of /libraries and into /core, so the MY_Log.php file that Heroku docs give you should go in /core, not /libraries as stated.
Once I got logging fixed the error was pretty straightforward...I just needed to set in the config.php:
$config['sess_save_path'] = sys_get_temp_dir();
This was new in 3.x and I had overlooked it. I had it blank when it is now required.
Hope this helps somebody.