I can't change the php.ini for some reason,
how can I do it in code level?
I can't change the php.ini for some reason,
how can I do it in code level?
Try
ini_set
— Sets the value of a configuration optionExample from Manual:
if (!ini_get('display_errors')) {
ini_set('display_errors', 1);
}
but keep in mind your hosting service might have disabled programmatic setting of ini settings.
Also keep in mind that you have to have error_reporting
enabled:
error_reporting
— Sets which PHP errors are reportedExample from Manual:
// Report all PHP errors
error_reporting(-1);
Use ini_set
(http://ca2.php.net/manual/en/function.ini-set.php)
Specifically,
ini_set('display_errors', 'E_ALL');
should work
error_reporting(-1); //Passing in the value -1 will show every possible error, even when new levels and constants are added in future PHP versions
ini_set('display_errors', 'On');
Doc available there:
Another way (if your server supports it) is with an .htaccess file:
php_flag display_errors on
php_value error_reporting -1
Runtime configuration of error reporting can be finetuned with a number of functions, listed here: http://www.php.net/manual/en/errorfunc.configuration.php
But most directly related to your question, use error_reporting(E_ALL), and display_errors(1)
In PHP:
error_reporting(E_ALL | E_STRICT);
From an .htaccess file:
php_value error_reporting 6143
6143 is the integer value of E_ALL, since apache won't understand "E_ALL"