Why is it that I never get any PHP errors? Where can you deactivate/activate it?

have tried to put error_reporting(E_ALL); in the top of my code, but still no display errors

I'm on my own dedicated server so have permission to change the settings needed


If you are referring to errors displayed on the webpage, you can enable it in php.ini (it is typically disabled for security on production systems). The value is called 'display_errors' (set to 1 to enable).

Alternatively, you can enable it on a per-script basis using the PHP error_reporting function.

In your PHP script add: error_reporting(E_ALL);

OR use: ini_set('display_errors', 1);

(Keep in mind that some hosts might not permit modifying certain values with ini_set. You should try the error_reporting function in preference.

If you are referring to errors in your server logs, ensure that error logging is enabled in your httpd.conf (for apache).

  • I'm on my own dedicated server so I have permission to change all settings.. but I can't make error_reporting(E_ALL); work.. I just put it in the top of my code – clarkk Jul 4 '11 at 20:30
  • (I presume of course, there is an actual error to display); Set the error_reporting and display_errors values in php.ini (See: ca2.php.net/manual/en/…) – cyberx86 Jul 4 '11 at 20:38
  • there is an error.. but when using ini_set('display_errors', 1); not all errors are shown compared to when changing display_errors in php.ini – clarkk Jul 4 '11 at 20:44
  • If some errors are displayed, and you want to see more errors, change the value of error_reporting. Either use error_reporting(-1) to see all errors or try error_reporting(E_ALL|E_STRICT); See: ca2.php.net/manual/en/function.error-reporting.php – cyberx86 Jul 4 '11 at 20:49

error reporting is set in your php.ini file

check the settings for error_reporting and display errors display_errors.

In dev env they should be:

error_reporting = E_ALL|E_STRICT
display_errors = On

in php.ini search for

  • display_errors and set it to ON,
  • check error_reporting for configuration (default is E_ALL & ~E_NOTICE)
  • check if log_errors is on, if yes, then they are logging somewhere specified by error_log
  • check your source for functions which can change those values and check for funcions set_error_handler which can set custom error handler

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.