• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Forwarded to devs Plesk Onyx 17.8 PHP 7.3 Handler Logs All Levels to Syslog

pleskpanel

Regular Pleskian
TITLE:
Plesk Onyx 17.8 PHP 7.3 Handler Logs All Levels to Syslog
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:
17.8.11 Update #71, CentOS Linux 7.7.1908
PROBLEM DESCRIPTION:
Following addition of the Plesk PHP 7.3.10 handler version via the Plesk components tool, all PHP errors that use it are being logged into the /var/log/plesk-php73-fpm/error.log file regardless of log_level.

This is not a domain-level concern (Apache error log for a particular domain took a lot of disk space on a server deals with a site writing lots of errors to the site's error logs).

Similar issue noted here: Issue - Since PHP 7.3 many function errors (FPM)
STEPS TO REPRODUCE:
  1. Add PHP 7.3 handler support via Plesk GUI
  2. Change a website plan to use PHP 7.3 handler
  3. Uncomment and set log_level = alert in /opt/plesk/php/7.3/etc/php-fpm.conf
  4. Restart services or server for good measure
ACTUAL RESULT:
PHP warnings (not handler alert-level warnings) are being written to /var/log/plesk-php73-fpm/error.log, causing very large syslog files.

(they continue to be written to the proper site-level error log as well)​
EXPECTED RESULT:
Should work as previous Plesk-installed PHP handler versions (PHP 7.2 and below) as documented in Log files occupy a lot of disk space because PHP log_level = notice. Is it possible to change the default value? in which only handler alerts were logged to the syslog file.​
ANY ADDITIONAL INFORMATION:
Added this to the "Additional Directives" of the PHP 7.3 plan via Plesk to suppress errors:

[php-fpm-pool-settings]
catch_workers_output = no

This seems to have stopped writing all errors entirely to the syslog.
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM:
Confirm bug
 
From developer:

Unable to reproduce explicitly.
It may be issued with broken backward compatibility between 7.3 and 7.2. (described here,
Some code (if it is executed with 7.3) now can throw errors.

Code:
PHP message PHP Parse error: Invalid body indentation level (expecting an indentation level of at least 3) in /var/www/vhosts/exam-pc7.cc/httpdocs/test/php/test.php on line 18"

So example of log with the warnings described STR is required.
 
here are some examples of code that was previously only written to the site's PHP error log and is now being written to the handler's log instead:

PHP message: PHP Warning: Declaration of Texas_Ranger::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /var/www/vhosts/domain0/httpdocs/wp-content/themes/domain0/functions.php on line 405"
PHP message: PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /var/www/vhosts/domain3.com/httpdocs/wp-content/plugins/revslider/includes/output.class.php on line 3525"
PHP message: PHP Warning: A non-numeric value encountered in /var/www/vhosts/domain1.net/httpdocs/wp-content/plugins/slider-image/slider.php on line 2295"
PPHP message: PHP Warning: Illegal string offset 'Normal' in /var/www/vhosts/domain2.com/httpdocs/wp-content/plugins/store-locator/sl-inc/includes/mapdesigner-options.php on line 87"
 
Last edited:
From developer:

Add PHP 7.3 handler support via Plesk GUI
I could not get the point of this step. PHP-7.3 provided by Plesk should be available without additional actions.

Questions to the topic starter:

First of all, saying that "Handler Logs All Levels to Syslog", do you mean namely syslog (journalctl output, /var/log/message or any other file managed by syslog daemon) or the file written by php-fpm daemon directly: /var/log/plesk-php73-fpm/? Please, check if you have error_log = syslog in the php-fpm configuration files. See PHP: Configuration - Manual for the reference.

Could you, please, confirm that there are no other log_level directives in the configuration files

# grep -R log_level /opt/plesk/php/7.3/etc/php-fpm.conf /opt/plesk/php/7.3/etc/php-fpm.d

If you are sure that the problem appeared in PHP-FPM 7.3.10 and there are was no similar messages in 7.3.9 and earlier than changes in behaviour could be caused by
  • FPM:
  • Fixed bug #78334 (fpm log prefix message includes wrong stdout/stderr notation).
PHP: PHP 7 ChangeLog
PHP :: Bug #78334 :: fpm log prefix message includes wrong stdout/stderr notation

Particular message

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

Is not generated by PHP-7.2 at all. Additional checks have been added in PHP-7.3 to help site developers to avoid mistakes in the code. So the only way to avoid such messages is to fix the code of the sites.

Such messages are not controlled by the global log_level directive, they are managed by catch_workers_output and so domain specific in Plesk. On my test server catch_workers_output = no causes writing messages to the domain web server logs. Is it that you are trying to achieve? Maybe you could try error_log ini parameter (that is not php-fpm configuration directive) PHP: Runtime Configuration - Manual There are messages generated by the process manager (master process) itself and entries from php interpreter run by children processes, they are managed through different configuration directives.

Did you use fcgi or fpm handler previously when logs worked accordingly to your expectations?

So I do not see any actual problem. And I am still not sure that I have got your point correctly. The default configuration for catch_worker_output is a matter of discussion but it is a question if all customers expect the same behaviour.
 
Thank you for your follow-up!

Here are the answers to your questions:

- PHP errors using the Plesk PHP 7.2 handler were written to the site's error log and not the /var/log/plesk-php73-fpm/ error file

- "Add PHP 7.3 handler support via Plesk GUI" (this refers to adding the PHP 7.3 handler via the Plesk component installer, not a manual install)

- # grep -R log_level /opt/plesk/php/7.3/etc/php-fpm.conf /opt/plesk/php/7.3/etc/php-fpm.d returns:

/opt/plesk/php/7.3/etc/php-fpm.conf:log_level = alert

- Previously PHP 7.2 with FPM was used (not Fast CGI)

Does that better clarify?
 
Back
Top