I have the umask set up on my Apache2 server using umask 002
. This is added to the end of /etc/apache2/envvars
during the docker container build.
I have the following script to test:
// Create file
if ($fp = fopen(time() . '.txt', 'w')) {
fwrite($fp, 'This is a simple test.');
fclose($fp);
echo "done";
} else {
echo "error - cannot create file";
}
// Generate error
error_log("This be an error", 0);
This creates 2 files: error_log_dev
(as set in my php.ini) and 1520215096.txt
. The permissions for each of these files are as follows:
-rw-rw-r-- 1 www-data www-data 22 Mar 5 11:58 1520215096.txt
-rw-r--r-- 1 www-data www-data 55 Mar 5 11:58 error_log_dev
Why would the error log not be abiding by the umask but fopen()
does?