I already tried with the directive init_set
, the file index.php
is set to ENVIRONMENT=DEVELOPMENT
, I have searched a lot on the web and nothing has worked for me.
I don't have access to server configuration files, that's why I need to activate the messages, because debugging is complicated like that.
Solution This was the modification I made in the index.php
define('ENVIRONMENT', 'development');
/**** ERROR REPORTING
Different environments will require different levels of error reporting.
By default development will show errors but testing and live will hide them.*/
switch (ENVIRONMENT)
{
case 'development':
error_reporting( E_ALL );
ini_set('display_errors', 1 );
break;
case 'testing':
case 'production':
ini_set('display_errors', 0);
if (version_compare(PHP_VERSION, '5.3', '>='))
{
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
}
else
{
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
}
break;
default:
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'The application environment is not set correctly.';
exit(1); // EXIT_ERROR
}
For old versions of CodeIgniter
The file
index.php
contains a call toini_set('error_reporting', ..);
, to change the behavior on such errors.This is what the default file looks like:
Below that line, add
ini_set('display_errors', 1);
and the errors will be displayed.In the current version of CodeIgniter (January 2018) .
It
index.php
has a switch and a variable to indicate the type of environment:You just have to change the value in this function:
The errors are probably not displayed because the value is set
production
to instead ofdevelopment
.