Error Log

You will find many helpful descriptions in the error logfile. As mentioned above, you should be able to locate the file under the web server’s installation folder in a folder called logs. You should make it part of your debugging routine to check this file for helpful clues as to what might be amiss. Here is just a sample of the verbosity of an error logfile:

[20-Apr-2012 15:10:55] PHP Notice:  Undefined variable: size in C:\Program Files (x86)
[20-Apr-2012 15:10:55] PHP Notice:  Undefined index: p in C:\Program Files (x86)\Zend
[20-Apr-2012 15:10:55] PHP Warning:  number_format() expects parameter 1 to be double
[20-Apr-2012 15:10:55] PHP Warning:  number_format() expects parameter 1 to be double
[20-Apr-2012 15:10:55] PHP Deprecated:  Function split() is deprecated in C:\Program
[20-Apr-2012 15:10:55] PHP Deprecated:  Function split() is deprecated in C:\Program
[26-Apr-2012 13:18:38] PHP Fatal error:  Maximum execution time of 30 seconds exceeded

As you can see, there are a few different types of errors being reported here, with their respective time stamps, file locations, and the line on which the error occurred. There are notices, warnings, deprecation notices, and a fatal error here for you to see.

Note

Depending on your environment, some commercial server space providers do not grant access based on security issues, so you may not have access to the logfile. Be sure to select a production provider that provides you with access to the logfile. Additionally, note that the log ...

Get Programming PHP, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.