Codeigniter displays a blank page instead of error messages
Solution 1:
Since none of the solutions seem to be working for you so far, try this one:
ini_set('display_errors', 1);
http://www.php.net/manual/en/errorfunc.configuration.php#ini.display-errors
This explicitly tells PHP to display the errors. Some environments can have this disabled by default.
This is what my environment settings look like in index.php
:
/*
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT
*---------------------------------------------------------------
*/
define('ENVIRONMENT', 'development');
/*
*---------------------------------------------------------------
* ERROR REPORTING
*---------------------------------------------------------------
*/
if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
// Report all errors
error_reporting(E_ALL);
// Display errors in output
ini_set('display_errors', 1);
break;
case 'testing':
case 'production':
// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);
// Don't display errors (they can still be logged)
ini_set('display_errors', 0);
break;
default:
exit('The application environment is not set correctly.');
}
}
Solution 2:
Make sure php5-mysql
is installed.
Solution 3:
I had this same problem and as Shayan Husaini pointed out, I had an undetected syntax error.
I solved it using the php linter in the terminal:
php -l file.php
You can also use something like this to use the linter in every file in some folder:
find -type f -name "*.php" -exec php -l '{}' \;
And to filter just the ones with errors:
find -type f -name "*.php" -exec php -l '{}' \; | grep '^[^N]'
That should show files with parsing errors and the line where the error is.