Re: [PHP] errors not showing
On Sun, May 20, 2012 at 3:30 PM, Maciek Sokolewicz wrote: > On 20-05-2012 07:17, tamouse mailing lists wrote: >> >> Are these syntax errors or run-time errors? The former won't display >> to the page at all, as they abort PHP before that point. Those written >> to wherever PHP is set to log errors, which might be the same as the >> apache error log unless you've set something specifically for it in >> php.ini. >> >> The best way I've found to suss out syntax errors is to "lint" the >> source file with php -l from the command line. >> >> On the other hand, if they are not syntax errors, then make sure you >> set error_reporting and display_errors (I also always set >> display_startup_errors as well) soon enough to catch them (and that >> nothing you include turns them off). > > > I always find it useful to check these values not by grep'ing the php.ini > file, but by checking phpinfo() output. Just make a new file with > phpinfo(); > > in it, and run it in the browser. That will show you the values of > display_errors and error_reporting that are actually used. I have seen cases > where the php.ini file a person thought was being used was actually NOT > used, and as such changing values inside that file had no effect. > > - Tul Good point! Seems best to see what the application believes is happening. The phpinfo() will also tell you just which php.ini file(s) is(are) being read. Usual caveats about leaving such a file unprotected on a publicly accessible server and what not. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] errors not showing
On 20-05-2012 07:17, tamouse mailing lists wrote: Are these syntax errors or run-time errors? The former won't display to the page at all, as they abort PHP before that point. Those written to wherever PHP is set to log errors, which might be the same as the apache error log unless you've set something specifically for it in php.ini. The best way I've found to suss out syntax errors is to "lint" the source file with php -l from the command line. On the other hand, if they are not syntax errors, then make sure you set error_reporting and display_errors (I also always set display_startup_errors as well) soon enough to catch them (and that nothing you include turns them off). I always find it useful to check these values not by grep'ing the php.ini file, but by checking phpinfo() output. Just make a new file with in it, and run it in the browser. That will show you the values of display_errors and error_reporting that are actually used. I have seen cases where the php.ini file a person thought was being used was actually NOT used, and as such changing values inside that file had no effect. - Tul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] errors not showing
On Sat, May 19, 2012 at 11:16 PM, Tim Dunphy wrote: > Hello Simon, > > Thanks for your response. > > However I still can't seem to get errors to show up. > > [dunphy@localhost:~/jf-current] #cat /private/etc/php.ini | grep -e > error_reporting -e display_errors > ; display_errors > ; error_reporting > error_reporting = E_ALL & E_NOTICE > ;error_reporting = E_ALL & ~E_DEPRECATED > display_errors = On > ; separately from display_errors. PHP's default behavior is to suppress those > ; Eval the expression with current error_reporting(). Set to true if you want > ; error_reporting(0) around the eval(). > > [dunphy@localhost:~/jf-current] #sudo apachectl -t > Syntax OK > > [dunphy@localhost:~/jf-current] #sudo apachectl restart > > > [dunphy@localhost:~/jf-current] #uname -a > Darwin localhost 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 > 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 i386 > > I was wondering if there might be something else I might've missed? > > Thanks > Tim > > On Sat, May 19, 2012 at 11:57 PM, Simon J Welsh wrote: >> On 20/05/2012, at 3:55 PM, Tim Dunphy wrote: >> >>> hello, list! >>> >>> I have 'error_reporting = E_ALL' set in my php.ini file. However when >>> I run a php script that has errors in it all that happens is that the >>> page WSODs. I am running Mac OS X 10.6. Any thoughts on why errors >>> don't show up in the browser and how to correct this? >>> >>> >>> Thanks >>> Tim >> >> You also need to set display_errors to On. >> --- >> Simon Welsh >> Admin of http://simon.geek.nz/ >> > > > > -- > GPG me!! > > gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > Are these syntax errors or run-time errors? The former won't display to the page at all, as they abort PHP before that point. Those written to wherever PHP is set to log errors, which might be the same as the apache error log unless you've set something specifically for it in php.ini. The best way I've found to suss out syntax errors is to "lint" the source file with php -l from the command line. On the other hand, if they are not syntax errors, then make sure you set error_reporting and display_errors (I also always set display_startup_errors as well) soon enough to catch them (and that nothing you include turns them off). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] errors not showing
Hello Simon, Thanks for your response. However I still can't seem to get errors to show up. [dunphy@localhost:~/jf-current] #cat /private/etc/php.ini | grep -e error_reporting -e display_errors ; display_errors ; error_reporting error_reporting = E_ALL & E_NOTICE ;error_reporting = E_ALL & ~E_DEPRECATED display_errors = On ; separately from display_errors. PHP's default behavior is to suppress those ; Eval the expression with current error_reporting(). Set to true if you want ; error_reporting(0) around the eval(). [dunphy@localhost:~/jf-current] #sudo apachectl -t Syntax OK [dunphy@localhost:~/jf-current] #sudo apachectl restart [dunphy@localhost:~/jf-current] #uname -a Darwin localhost 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 i386 I was wondering if there might be something else I might've missed? Thanks Tim On Sat, May 19, 2012 at 11:57 PM, Simon J Welsh wrote: > On 20/05/2012, at 3:55 PM, Tim Dunphy wrote: > >> hello, list! >> >> I have 'error_reporting = E_ALL' set in my php.ini file. However when >> I run a php script that has errors in it all that happens is that the >> page WSODs. I am running Mac OS X 10.6. Any thoughts on why errors >> don't show up in the browser and how to correct this? >> >> >> Thanks >> Tim > > You also need to set display_errors to On. > --- > Simon Welsh > Admin of http://simon.geek.nz/ > -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] errors not showing
On 20/05/2012, at 3:55 PM, Tim Dunphy wrote: > hello, list! > > I have 'error_reporting = E_ALL' set in my php.ini file. However when > I run a php script that has errors in it all that happens is that the > page WSODs. I am running Mac OS X 10.6. Any thoughts on why errors > don't show up in the browser and how to correct this? > > > Thanks > Tim You also need to set display_errors to On. --- Simon Welsh Admin of http://simon.geek.nz/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] errors not showing
hello, list! I have 'error_reporting = E_ALL' set in my php.ini file. However when I run a php script that has errors in it all that happens is that the page WSODs. I am running Mac OS X 10.6. Any thoughts on why errors don't show up in the browser and how to correct this? Thanks Tim -- GPG me!! gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php