Multiple PHP error_log files
We have recently moved from a VPS with CentOS 6 to a new one with CentOS 7, both using WHM and cPanel.
On the old server we had multiple websites and domains but all hosted under a single cPanel user account. When migrating to the new server we took the opportunity to separate this into a cPanel user account for each website / domain.
Previously we had it configured so that all PHP errors would go to a single error_log file in /var/log/apache/error_log. We did this by commenting out the following line in the global php.ini:
We have done this on the new server but are still seeing an error_log file in each folder where PHP files are executed. I see that there is a "MultiPHP INI Editor" for each cPanel account but none of these are populated by default, therefore I assumed they would be using the global configuration. I would appreciate any suggestions.
;error_log = error_log
We have done this on the new server but are still seeing an error_log file in each folder where PHP files are executed. I see that there is a "MultiPHP INI Editor" for each cPanel account but none of these are populated by default, therefore I assumed they would be using the global configuration. I would appreciate any suggestions.
-
I believe they are all goes to error_log but under their respective public_html folder. Did you set the same PHP version for all of them? If not make sure it is enabled and set in each PHP ini file. 0 -
@f1alan - on my personal system, by default I do get the error_log created in /home/username/public_html. I also confirmed that commenting out the line you mention in the global configuration stop the log from being written locally and the log entry only shows up in /etc/apache2/logs/error_log. In order to ensure you've commented out the correct global file, I'd recommend making that change from WHM >> MultiPHP INI Editor under the "Editor Mode" tab for the version you want to adjust. Can you try that and let me know the results? 0 -
@f1alan - on my personal system, by default I do get the error_log created in /home/username/public_html. I also confirmed that commenting out the line you mention in the global configuration stop the log from being written locally and the log entry only shows up in /etc/apache2/logs/error_log. In order to ensure you've commented out the correct global file, I'd recommend making that change from WHM >> MultiPHP INI Editor under the "Editor Mode" tab for the version you want to adjust. Can you try that and let me know the results?
Thanks for your response. I double checked the setting and it was indeed as I described above. However, it seems to be behaving as expected now. I think I must have confused some old log files yesterday (which I have now deleted). Sorry for the false alarm.0 -
No worries at all - I'm glad things are working how you expect now! 0
Please sign in to leave a comment.
Comments
4 comments