PHP Error logging to general Apache log
I have a developer that I do not wish to give CLI access to, and wishes to have the ability to see PHP errors on the cPanel apache error_log, just like we used to on our plesk platform.
Currently error_log is output to the directory where the erroring script is housed. I understand this to be the default behavior. I would like to direct all PHP error output (when enabled) to the base apache error_log that cPanel processes for the error log feature in the panel. I understand this path to be /usr/local/apache/logs/error_log.
My concern is that cPanel will not know how to break this down per account like it does currently for the apache logs. I am looking for an effective way to view all PHP errors for an individual account, that can be done through the cPanel interface, without the need to download the file. To be clear, any solution would need to aggregate all PHP errors for all scripts into a single place that is either per account (one file per account) or able to be parsed on a per account basis.
I would love to use the built in error_log viewer, in cPanel, that apache uses, but need to know if this is a feasible idea.
Pertinent Versions:
/etc/redhat-release:CentOS release 6.7 (Final)
/usr/local/cpanel/version:11.52.1.2
/var/cpanel/envtype:kvm
CPANEL=release
Server version: Apache/2.4.12 (Unix)
Server built: Jun 26 2015 04:46:02
Cpanel::Easy::Apache v3.30.2 rev9999
PHP 5.4.42 (cli) (built: Jun 26 2015 04:50:19)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies
with Suhosin v0.9.36, Copyright (c) 2007-2014, by SektionEins GmbH
mysql Ver 14.14 Distrib 5.5.46, for Linux (x86_64) using readline 5.1
-
Hello :) Have you considered changing the path to where the PHP error log is stored? There's documentation on this at: PHP: Runtime Configuration - Manual This might help you to create a custom cPanel plugin, as there's no native feature that will include the PHP error output in the "Error Log" option in cPanel. Thank you. 0 -
I was afraid that this was the answer that I was going to get. Thank you for the time to respond, I will start with a skel update to direct all PHP errors for a single user to the document root instead of all over the place. From there I may invest the time to write something to handle this. Thank you again. 0
Please sign in to leave a comment.
Comments
2 comments