Jump to content

Recommended Posts

I am developing on Mac OS 10.5.5 with all of the latest patches.

 

Some time ago when I was developing some PHP code for a web site on my iMac the code would report an error and fail the page if my PHP code referenced a variable that did not exist. This was great since it allowed me to find typing errors.

 

Since then I have upgraded my system several times, and now any reference to a non-existent variable simply results in a null value -- which makes it much more difficult to locate such problems.

 

How can I enable, either permanently, temporarily or per execution the debug mode where references to undefined variables results in a fatal error?

For errors to be displayed during runtime you'll also need to to make display_errors is enabled.

 

You can set this within your php.ini

display_errors = On

 

Or via ini_set in your scripts

error_reporting(E_ALL);
ini_set('display_errors', 'On');

Or via ini_set in your scripts

error_reporting(E_ALL);
ini_set('display_errors', 'On');

 

Does the ini_set() function permanently change the contents of the php.ini file, or does the change only last for the remainder of the page or the session?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.