Your Open Source

 
Related Posts

How do I enable error logging for PHP scripts?

PHP error logging is disabled on all of the servers. To enable error logging of PHP scripts:

If you do not currently have a php.ini, make one and place it in the same folder(s) as the PHP script(s) that you want to track errors for. You will need to add the following 2 lines:

log_errors = On
error_log = error_log

For example, let's say you have a shopping_cart.php in /home/yourUserName/public_html/cart/
and you want error logging in place for the shopping_cart.php. Create a php.ini file (this can be done with any text editor, such as notepad.exe), add the 2 lines from above to it, save it, and place it in the cart/ directory. Uploading the new php.ini can be done via FTP or the built in File Manager utility from within cPanel.

If you do currently have a php.ini file in the same directory as the PHP script you want logging enabled for, simply add the 2 lines from above to the php.ini file and save it using either of the methods outlined above.


Should you choose to enable error logging, you MUST check your error_log often and take corrective actions for persistent errors. If you notice your error_log growing in size very rapidly, there is a serious problem with one or more of your PHP scripts that must be fixed. Often times simply checking the vendor's website for an update can lead to a quick, simple solution. An error log greater than 1M in size is the sign of a serious problem. An error log that has been written to numerous times in 1 or 2 seconds is also the sign of a serious problem.

  • hits 145
  • datetime Jul 31 09 02:42:45
  • author Tjrambabu
  • rating

Rating : 12345
Tags :- Linux

Answers

No Answers..
Your Name:
Your Answers :
<> is a code tag
Preview
Enter the verification code: