[php-src] Issue #12777: error_log() doesn't respect error_log_mode INI setting
| From: | SPKSmithy | Date: | Fri, 24 Nov 2023 23:45:33 +0000 |
| Subject: | [php-src] Issue #12777: error_log() doesn't respect error_log_mode INI setting | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245890@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12777
Author: SPKSmithy
### Description
Logs created by PHP's error_log INI setting have the correct mode but the error_log() function
appears to ignore the error_log_mode setting. I've tried setting error_log_mode using ini_set()
and as a PHP-FPM php_admin_value.
The following code:
```php
<?php
ini_set('error_log_mode', '0o200');
error_log('Something went wrong', 3, 'exceptions.log');
```
Resulted in this output:
```
-rw-r--r--. 1 apache apache 20 Nov 24 23:07 exceptions.log
```
But I expected this output instead:
```
--w-------. 1 apache apache 20 Nov 24 23:07 exceptions.log
```
### PHP Version
PHP 8.2.13
### Operating System
Rocky Linux 9.2 (Blue Onyx)