One of the most useful and equally underused tools for trouble-shooting PHP are log files. PHP can be configured to write all kinds of information and detail to a system-wide log file that will be a valuable resource when the time comes to track down some illusive bugs.
There are several reasons you should be using and reviewing log files regularly, including the following:
Log files give you access to historical debug info. If you receive an error report, but are unable to duplicate the problem yourself, you can consult the log file(s) to see if there is anything that was recorded at the time of the incident.
Log files contain cumulative information. Error messages in the browser describe the state of the code at a particular point in time—often at the time when it crashed. In contrast, log files span a period of time that can range from a few seconds to months or even years. Having access to so much historical data lets you learn about the frequency and severity of issues with your...