• We value your experience with Plesk during 2026
    Please help us understand which Plesk features made your work easier this year, what is still missing and how AI should help you in Plesk ?
    Take this short 5-minutes survey. Your answers go straight into the Plesk roadmap for 2027.

Question Change error log location

Kaspar

API expert
Plesk Guru
I'd like to change the location PHP error log file to the same directory as the PHP file that caused the error.

So for example if a PHP file resides in domainname.com/httpdocs/classes/ and a error occurs a error log file is created in the same directory. This seems a bit harder to achieve than I anticipated.

I have been able to change the error log location to the document root of the domain by setting: error_log = "{DOCROOT}{\}error_log" in the PHP ini file. But I am not sure how to change the error log setting to use the same directory as the PHP file that caused the error.

Any one has any suggestions?
 
I don't think that's easily possible. You would have to create your own PHP framework and instruct all your PHP scripts to output any errors to a dynamic log file location. But then again I'm not a coder.

Anway, I would recommend to keep your PHP error logs outside of the document root, as they may contain sensitive information and you probably don't want anybody to be able to read your logs....
 
This is also a bad idea because a huge error log file can very quickly take up disk space on your domain, and therefore the domain will be suspended due to limit overusage.
 
Back
Top