Skip to content
Advertisement

Cannot get php display_errors enabled

Hey i know there are a few posts regarding this topic and i have scoured them all!

I cannot not enable the display_errors setting in php no matter what i do!!!

Im using virtual box with php 5.3 installed with apache2 running. i have tried everything i can think of to get display errors working but nothing seems to work.

I have set php_flag display_errors on in my .htaccess file i have even enabled it directly in the php.ini file

display_errors = 1

and also tried

display_errors = On

I am using the defaults for apache sites-enabled is there something i need to do here to get this to work?? i have never had this problem running php on my mac using mamp.

Any suggestions would be greatly appreciated this is driving me nuts!

Advertisement

Answer

You can also enable it in your PHP script usually:

ini_set("display_errors", 1);
ini_set("track_errors", 1);
ini_set("html_errors", 1);
error_reporting(E_ALL);

If that doesn’t help, then try a quick workaround first:

set_error_handler("var_dump");

Could be used to replicate the original behaviour, if it’s suppressed by some other circumstance.

Take in mind, this only works for enabling runtime errors. If you suspect parse errors, you’ll definitely have to enable error display in the php.ini / .htaccess / .user.ini. — Else make a wrapper test.php script with above instructions, then include() the faulty script.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement