I'm trying to write contents to file, however I constantly receive error about lacking permission.
fopen(/var/www/html/files/l.log) Failed to open stream permission denied in /var/www/html/files/file.php
PHP code l use:
$path = __DIR__.'/l.log';
$logfile = fopen($path, "a+") or die();
After checking php and apache processes with:
ps aux | grep apache2
ps aux | grep httpd
ps aux | grep php
I know they both have root and www-data permissions
I tried transferring ownership to www-data or adding permissions for reading and write:
sudo chown www-data:www-data /var/www/html/files/l.log
sudo chmod 755 /var/www/html/files/
sudo chmod 664 /var/www/html/files/l.log
But that didn't work. I also don't have SElinux as mentioned in another post.
/etc/group
hasDUMMY:65535:
as the very last line.