RE: [PHP] Problem with PHP and mounted folder
| From: | Cliff Nieuwenhuis | Date: | Fri, 28 Feb 2014 18:00:42 +0000 |
| Subject: | RE: [PHP] Problem with PHP and mounted folder | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-323007@lists.php.net to get a copy of this message | ||
Cliff Nieuwenhuis wrote:
[snip]
> The web application needs to read and create files in the projects folder, but
> PHP doesn't recognize the projects folder as folder! I suspect a
> permissions problem of some sort, but I can't figure out where.
[snip]
Aziz Saleh wrote:
> You guessed right. PHP usually runs under a user with less permissions (www, user, etc..). You
> are probably
> logged in as a user with permissions to access that mounted drive while PHP isn't. Both
> fixes are ugly, but
> what I would recommend is giving permission to those files as opposed to giving PHP user more
> power.
Thanks for the reply.
I thought that PHP runs under HTTPD as user 'apache'. I know that the Apache webserver
runs as user 'apache' on my system -- does PHP run as a different user? Assuming that it
does not, wouldn't my successful test of traversing, reading, and writing files under the
'projects' folder by doing 'su - apache -s/bin/bash' mean that the permissions
are OK? I guess not, but I can't see why not.
--
Cliff Nieuwenhuis