When our site used to be on IIS hosting with PHP installed, I had error reporting set to E_NONE and was able to turn it on temporarily by using:

ini_set('display_errors', 1);

That command seems to no longer work now that we are on Linux/Apache hosting. I have tried purposely sending bad commands to the server and I get no errors reported.

What am I doing wrong? Is there any other way to temporarily turn on error reporting without having to edit the php.ini each time?


IMHO, this sort of stuff is best set server wide (dev or prod) in your php.ini file. I really love when people do file specific error display, it just creates a mess.

Written by Jakub

If I do it on the server, then it displays on the entire site. By adding it to the page, it only displays on that page.

Written by shummel7845

Accepted Answer

You can change error reporting to E_ALL using the following line:


Try adding that to the file.

Written by Rocket
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki