6/29/2007
Coding on a Live Site
I have written several times about debugging a live site and posted snippets for working on the themes of a live Wordpress install. One trick I haven’t mentioned is using the PHP error log.
PHP on any production site should be configured to not display errors. I see all too often on random sites that PHP has been configured to show errors (sometimes even in Google results). This gives away too much information about your application and server.
On the servers and applications I work on all of the time, I configure PHP to log errors to /var/log/php_errors. Simply tailing this file through a console will quickly show any errors caused by the edits.
To enable logging, check these two variables in your php.ini:
; As stated above, you’re strongly advised to use error logging in place of
; error displaying on production web sites.
log_errors = On
;error_log = filename
error_log = /var/log/php_errors
To tail the log file from an SSH console:
Popularity: 24%


