Skip to main content

Adjusting PHP-FPM Error Reporting to ignore NOTICE

Comments

3 comments

  • cPRex Jurassic Moderator

    Hey there!  No, you're definitely setting the value correct, but I think there's some confusion on what exactly is being logged.

    When you make the change to use E_ALL & ~E_NOTICE you are keeping *domains* from logging that information to /home/username/logs/domain.com.error.log (or whatever your particular local PHP log file is).  What you're seeing in /opt/cpanel/.........error.log is the logs for the PHP-FPM daemon process itself, and even though they show up as NOTICE in that log file, those system logs aren't going to be suppressed.

    Is that log file in /opt getting unusually large on your system? 

    0
  • Metro2

    Thank you very much for the clarification!

    And to answer your question - I don't think the /opt/cpanel/ea-php83/root/usr/var/log/php-fpm/error.log files are unusually large (around 2MB to 4MB , but still pretty big for text files) , and filled with so many non-stop notices while I'm trying to troubleshoot PHP-FPM issues that are affecting my customers, that I wanted to quell it.

    I was able to quiet the log down by editing /opt/cpanel/ea-php83/root/etc/php-fpm.conf and changing log_level = notice to log_level = warning (and of course restarting phpfpm), and have now switched it back.

    Thank you again for the clarification / distinction between the setting and entries for /home/username/logs/ error log and the system's PHP log!

    0
  • cPRex Jurassic Moderator

    Sure thing!  And, I'll admit, it took me a while to figure this one out too :D

    0

Please sign in to leave a comment.