Turn off error logging for cPanel core PHP

fokakmeny

Member
Jan 15, 2012
12
0
51
cPanel Access Level
Root Administrator
I have PHP-FPM enabled in my server for cPanel services and users accounts logging all errors, notices. This is important for us since we manage all the code for 100+ accounts hosted in my server. We have SH script that searchs /logs/ folders in all accounts and notifies us if php error log found in these folders.
Recently I started to receive many error logs due to out-of-date cURL in CentOS 7 in 'carddav' roundCube plugin and some other notices from roundCube itself regarding undefined constants and variables types mismatches.
I made some workarounds into the code myself but I keep receiving notices from WHM that I have broken RPM and my changes are undone with every update.
I tried to disable PHP-FPM for cPanel core, but in that case I get Wordpress toolkit not working and I have 3 users using it.
I hope someone can guide me on how to stop error logs for cPanel core libraries or at least route them to another location.
Thanks.
 

fokakmeny

Member
Jan 15, 2012
12
0
51
cPanel Access Level
Root Administrator
Hey there! Can you let us know what specific changes you've made that lead to the broken RPM notifications? That is likely the critical issue here.
For this error as an example:
Code:
PHP Warning:  Use of undefined constant CURLAUTH_NEGOTIATE - assumed 'CURLAUTH_NEGOTIATE' (this will throw an Error in a future version of PHP) in /usr/local/cpanel/base/3rdparty/roundcube/plugins/carddav/vendor/mstilkerich/carddavclient/src/HttpClientAdapterGuzzle.php on line 106
I modifed CURLAUTH_NEGOTIATE to CURLAUTH_GSSNEGOTIATE in line 106, the carddav works fine with this modification and error doesn't appear. But I believe I get the email notification for the file being modified regardless it's working or not.

I don't remember other errors right now, when they appear again I will update the thread. However I remember one was about array index that wasn't quoted with "" or '' and assumed constant. I added quotes and the notice disappeared.

The last one was about function waiting for Datetime object but received string instead.

All these notices were related to roundCube itself or cardDav roundCube plugin.
Best Regards
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,292
2,438
363
cPanel Access Level
Root Administrator
I talked to the team about this and they confirmed that we don't support those types of changes.

If you'd like to see an option to disable the logging that part could make a good feature request. If you'd like to get that submitted I'll bring it up during next weeks' meeting.
 

fokakmeny

Member
Jan 15, 2012
12
0
51
cPanel Access Level
Root Administrator
I talked to the team about this and they confirmed that we don't support those types of changes.

If you'd like to see an option to disable the logging that part could make a good feature request. If you'd like to get that submitted I'll bring it up during next weeks' meeting.
Thank you for your reply. I really appreciate that you'll bring my subject up.
Turning off these logs will be feature, but I'd rather keeping it on it since I wouldn't notice these unless it was available.
However, the most important thing is to change their saving path outside users accounts since it's directly related to cPanel core functions and user is already helpless regarding such functions.
Best Regards
 

fokakmeny

Member
Jan 15, 2012
12
0
51
cPanel Access Level
Root Administrator
You're very welcome! If you get that feature request submitted I'll be sure to bring it up with the team.
I appreciate your effort, thank you.
I have submitted new feature request here: https://features.cpanel.net/topic/22517-controlling-cpanel-core-php-functions-errors-logs

In addition to previous notice for cURL constant, these notices appears occasionally as well.
Code:
PHP Warning:  trim() expects parameter 1 to be string, object given in /usr/local/cpanel/base/3rdparty/roundcube/program/lib/Roundcube/rcube_utils.php on line 992
Code:
PHP Warning:  Use of undefined constant DateTimeImmutable - assumed 'DateTimeImmutable' (this will throw an Error in a future version of PHP) in /usr/local/cpanel/base/3rdparty/roundcube/plugins/libcalendaring/libcalendaring.php on line 334
Best Regards.