Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to turn Php errors on!

Status
Not open for further replies.

JennyPeters

Programmer
Oct 29, 2001
228
US
I'm tring to turn PHP errors on to degug my work, but had had no luck.

I have used the following 3 lines:
ini_alter("display_errors", "1");
ini_alter("error_reporting", "E_ALL");
ini_alter("display_startup_errors", "1");

... which does turn them on according to phpinfo(), but still no error messages...

Is there something I am missing?

Thanks,

Jennny
 
I'm not certain, but I believe that when you make changes to the ini file you have to restart PHP in order for them to take effect.
 
Try doing it like this:

ini_alter("display_errors", "On");
ini_alter("error_reporting", "E_ALL");
ini_alter("display_startup_errors", "On");

("On" instead of the number 1).

Also, you have to remember the order of execution here. If you are making these calls somewhere in a PHP script, they will only affect errors that come after you turn on error reporting. In other words, this should be at the "top" level of your include files, or should be at the very top of the PHP script you are using. In fact, I don't know if the "display_startup_errors" setting will even work, because those errors occur upon startup of the webserver, and are thus "finished" before you enable that setting in your script. -------------------------------------------

Big Brother: "War is Peace" -- Big Business: "Trust is Suspicion"
(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top