dougwo
1
I have just moved our API to a new server with php7 instead of php 5.6. The following line is throwing a 500 error.
$auth = new Auth($this->db,$this->logger);
the $db construct was set in config/Settings.php
Any idea why this might error out? Perhaps a missing php module? Is there a slim -> php7 migration guide?
odan
2
The error 500 is a very general message from the server that an error has occurred.
Try the following:
- The server’s error log will provide more details about the error.
- Activate error details:
$settings['displayErrorDetails'] = true;
- Enable error reporting:
error_reporting(E_ALL);
ini_set('display_errors', '1');
- http://www.slimframework.com/docs/v3/handlers/error.html
- Logging errors in Slim 3
- Make sure the required PHP (7) extensions are installed
- Check the the filesystem (read / write) permissions.
- Check directories and filenames for lower- and uppercase (Windows <> Linux)
- Specify the PHP version under
config > plattform > version
value your composer.json
- Fix the autoloader. Run
composer update --no-dev
again
- Try to disable all middleware handler (temporary)
- Check all your PHP files for (syntax) errors with a PHPLint and PHPStan
- Clear the routing cache file (if exists)
- Does your Apache
DocumentRoot
points to the public
folder?
- Is the Apache
mod_rewrite
module enabled?
- Validate the database connection parameters.
- Enable PDO’s Exceptions: PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION