Re: Weird permission issue
| From: | Willie M | Date: | Tue, 07 May 2019 19:41:18 +0000 |
| Subject: | Re: Weird permission issue | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-326794@lists.php.net to get a copy of this message | ||
On 5/7/19 12:33 PM, Larry Martell wrote:
> I have a PHP app and it runs from /var/www/html/foo. It writes to a
> log file in there log.txt. To do some testing I created a dir
> /var/www/html/foo.new and installed the code there. To switch back and
> forth I do this:
>
> mv /var/www/html/foo /var/www/html/foo.old
> mv /var/www/html/foo.new /var/www/html/foo
>
> When I do that I get an error writing to the log file:
>
> Error #2: fopen(/var/www/html/foo/log.txt): failed to open stream:
> Permission denied
>
> But if I switch back:
>
> mv /var/www/html/foo /var/www/html/foo.new
> mv /var/www/html/foo.old /var/www/html/foo
>
> I do not get the error. The code is identical in foo and foo.new and
> the perms and owner on log.txt is identical in too and foo.new. I have
> tried restating apache and rebooting the machine, but no joy.
>
> What could be causing the permission error?
Who owns the foo.new and the foo.old directories? That is most likely
where the problem is.
--
Willie Matthews
matthews.willie80@gmail.com
(702) 659-9966