Set Permissions for Error Log File using error_log_mode in PHP 8.2

Set Permissions for Error Log File using error_log_mode in PHP 8.2

Since PHP 8.2, the error_log_mode INI directive can be used to set permissions for an error log file, which configured with the error_log directive. Default value is 0644. It means owner can read and write, group and others only can read. The error_log_mode directive can be set in the php.ini file.

error_log_mode=0664

The error_log_mode directive can also be set at runtime using the ini_set function.

<?php

ini_set('error_log_mode', '0664');

Leave a Comment

Cancel reply

Your email address will not be published.