Search Help:  
 
Enter keywords to search help.

How can I troubleshoot my scripts?

If you are using any PHP or Perl scripts, and you are familiar with web programming, you'll want to create script logs. Script logs are generated anytime an error occurs while you are running a PHP or Perl script. Like access logs, the scripts.log file is created and stored in the logs directory. You must create a logs directory before you can generate script logs. If this subdirectory does not exist, any error output caused by your PHP or Perl script will be discarded.

The scripts.log file can help you find and correct errors in your script more quickly than if you simply reread all of your code. Whenever there is an error or warning generated by PHP or Perl — for example, if there is a syntax error in your code that is causing your script to fail — these errors are written to the file "scripts.log." In the sample code below, for instance, you can see that there is a PHP error in line 9 of your script.

[26-Jun-2004 22:35:14\ PHP Parse error: parse error in /php/bug.php on line 9

We suggest that you password-protect your logs directory to prevent anyone from viewing potentially sensitive information.

Please note that your script log file can reach a maximum size of 10MB. If your file exceeds this size, your error output will no longer be recorded, and you could encounter a "500 Internal Server Error" on your PHP pages. To avoid these file-write problems, we recommend that you periodically rename or delete your scripts.log file.

Was this article helpful?

Yes   No
Click to contact Customer Care for further assistance.