Bug #71544 [Com]: Broken syslog ident(tag) on php-fpm environment
| From: | dominic at varspool dot com | Date: | Mon, 19 Dec 2016 22:20:55 +0000 |
| Subject: | Bug #71544 [Com]: Broken syslog ident(tag) on php-fpm environment | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206139@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71544&edit=1
ID: 71544
Comment by: dominic at varspool dot com
Reported by: sunnyone41 at gmail dot com
Summary: Broken syslog ident(tag) on php-fpm environment
Status: Open
Type: Bug
Package: *General Issues
Operating System: Ubuntu 14.04
PHP Version: 5.6.18
Block user comment: N
Private report: N
New Comment:
Duplicate of #67764
Previous Comments:
------------------------------------------------------------------------
[2016-02-07 16:18:18] sunnyone41 at gmail dot com
Description:
------------
When error_log = syslog is set at php.ini on php-fpm environment, broken ident (tag) is used like
this:
Feb 7 22:02:36 phphost ool www: ERRORTEST
^^^^^^^
This is caused by changing argv[0] by php-fpm. syslog() calls internally openlog() and it uses
__progname as the default ident value, but the pointer __progname indicates the place of basename in
old argv[0].
v after the last slash
/usr/sbin/php5-fpm <- original argv[0]
php5-fpm <- expected __progname
php-fpm: pool www <- customized argv[0]
ool www <- actual __progname
I think "ool www" is not expected for most people. openlog() with proper ident
(syslog.ident in php-fpm.conf?) argument should be called with php-fpm environment.
Test script:
---------------
<?php error_log("ERRORTEST") ?>
Expected result:
----------------
A line like below will be written:
Feb 7 22:02:36 phphost php-fpm: ERRORTEST
Actual result:
--------------
A line like below will be written:
Feb 7 22:02:36 phphost ool www: ERRORTEST
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71544&edit=1