Change PHP Log File Location

Avatar
  • updated
  • Answered

Right now, my PHP error log files are placed in the /logs root directory with the filename <domain>.php.error.log where <domain> is my domain name. I would like to change that, ideally, using the PHP ini_set() method. I have tried:

ini_set("error_log", "/home/<root directory>/public_html/_error_log.txt");  where <root directory> is my root directory name.

That didn't work, so I tried using the PHP editor in the cPanel to add

error_log "/home/<root directory>/public_html/_error_log.txt"  

That didn't work either. Same story with editing the .htaccess file.

How can I set the location and filename for my PHP error log file? The ini_set() method has worked with other hosting services.

Avatar
IMH Support Agent 2
  • Answered

Hello Mark,


Sorry for the issue with the PHP error log file placement.  Normally, the error log is placed through PHP.INI file.  You can see how the location is changed in this article:  How to Display and Log PHP Errors.

If you continue to have errors with the placement of the log file, please contact our live technical support team for further assistance.  If you have any further questions or comments, please let us know.


Kindest Regards,

Arnel C.