0
votes

I can't seem to get PHP to write to a text file on my Apache web server.

The file itself (log.txt) has an owner of "apache:apache" with access "-rw-rw-r--", its folder is owned by "apache:apache" and has permissions "drwxrwxr-x"...

Every time I tried to access log.txt, the Apache log reports "Permission Denied" on that file name.

Can anyone help?

Thanks.

1
What PHP runtime is used? FPM typically runs as a different user.mario
PHP 5.4.16 (cli) when I typed "php -v".Martin Blore
What info do you need from phpinfo() ?Martin Blore
"Apache 2.0 Handler"Martin Blore
iirc, apache runs as user www-data, not apache. Try changing it to that user.Ethan Brouwer

1 Answers

0
votes

apache usually runs as user www-data:www-data not apache:apache. Are you sure the right uid/gid?

Try writing to a new file and see who owns it