Bug #76573 [NEW]: Log file is created with wrong permissions if deprecated configuration found
| From: | mbiebl at messageconcept dot com | Date: | Tue, 03 Jul 2018 15:49:39 +0000 |
| Subject: | Bug #76573 [NEW]: Log file is created with wrong permissions if deprecated configuration found | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-216109@lists.php.net to get a copy of this message | ||
From: mbiebl at messageconcept dot com
Operating system: Windows Server 2016
PHP version: 7.2.7
Package: IIS related
Bug Type: Bug
Bug description:Log file is created with wrong permissions if deprecated configuration found
Description:
------------
We run PHP 7.2.7 under IIS/Windows Server 2016.
php.ini is setup to log to
error_log = "C:\Windows\temp\PHP72_errors.log"
We also use PHP Manager for IIS. If you use PHP Manager to switch into
Development mode, it will add the following to php.ini:
track_errors = On
With 7.2.7 this will trigger a deprecation warning.
A side effect of this is, that if the log file
C:\Windows\temp\PHP72_errors.log does not exist, it will be created
containing this line
[03-Jul-2018 17:37:22 Europe/Berlin] PHP Deprecated: Directive
'track_errors' is deprecated in Unknown on line 0
but more importantly the file permissions will be wrong. The IUSR (which
is used by IIS) will have no read/write/access permissions at all. So
subsequent calls to error_log() will fail.
If I remove "track_errors = On" from php.ini and trigger the file
creation via error_log() the file permissions are correct.
It seems when the php.ini is parsed and the deprecation notice logged, a
different code path is used to create the log file which does not setup
proper file permissions.
--
Edit bug report at https://bugs.php.net/bug.php?id=76573&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76573&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76573&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76573&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76573&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76573&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76573&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76573&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76573&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76573&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76573&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76573&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76573&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76573&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76573&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76573&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76573&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76573&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76573&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76573&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76573&r=mysqlcfg