Bug #69662 [NEW]: PHP Startup errors are erroneously logged as master user in pool error log

From: Date: Tue, 19 May 2015 15:48:40 +0000
Subject: Bug #69662 [NEW]: PHP Startup errors are erroneously logged as master user in pool error log
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192766@lists.php.net to get a copy of this message
From: reallfqq-php at yahoo dot fr Operating system: Linux PHP version: 5.4.41 Package: FPM related Bug Type: Bug Bug description:PHP Startup errors are erroneously logged as master user in pool error log Description: ------------ When dealing with startup errors in PHP-FPM, messages as the following are generated: PHP Warning: PHP Startup: Unable to load dynamic library '***' - ***: cannot open shared object file: No such file or directory in Unknown on line 0 The problem is, those end up in the file configured in the pool's error_log directive (either in php.ini or through php_[admin_]value in a pool in php-fpm.conf), not in the one configured through FPM's php-fpm.conf error_log directive. Since it is startup errors, the log entries are generated by the master process (which is usually root:root), thus generating the pool's error log with root:root rights, while the workers are fired up with user:group (configured in the pool). You end up in a situation where workers are unable to log error messages in their pool's defined error log (since user:group is unable to write in a log generated with root:root file with standard 644 mask). Any error generated at master level shall be logged in the master log file (configured through the FPM's error_log directive). Or you should ensure that everything ending up in the pool's error log is written with the pool's configured user:group permissions. Test script: --------------- 1°) Configure a non-existent module in FPM's php.ini: extension = nonexistent.so 2°) Clear any existing log file corresponding to the FPM's php.ini error_log directive or configured through FPM's php-fpm.conf php_[admin_]value. 3°) Restart PHP-FPM 4°) Pool's error log is created with root:root rights (644 mask) instead of either: a) using the FPM's error log file (configured through FPM's php-fpm.conf error_log) b) generating the error in pool's log file (configured through FPM's php.ini error_log or through php_[admin_]value) with the pool's defined user:group permissions -- Edit bug report at https://bugs.php.net/bug.php?id=69662&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69662&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69662&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69662&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=69662&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=69662&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=69662&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=69662&r=needscript Try newer version: https://bugs.php.net/fix.php?id=69662&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=69662&r=support Expected behavior: https://bugs.php.net/fix.php?id=69662&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=69662&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=69662&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=69662&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69662&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=69662&r=dst IIS Stability: https://bugs.php.net/fix.php?id=69662&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=69662&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=69662&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=69662&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=69662&r=mysqlcfg

« previous php.bugs (#192766) next »