You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by mb...@os.datafx.com.au on 2006/08/22 23:46:11 UTC

[users@httpd] Allow php scripts to create directories+files..

Hi,

We have a shared hosting platform, and have a requirement to allow php 
scripts to create directories+files - Problem is that php is run under 
apache user (www-data), and the users directories are owned by the 
user, so php script is getting permission denied...We could chmod 777 
on the directory, but I was hoping there was a more secure alternative?

Regards,
MB

-------------------------------------------------------------------------
This e-mail was sent via Data FX Online WebMail http://www.datafx.com.au/



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Allow php scripts to create directories+files..

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
> On 8/22/06, mb2@os.datafx.com.au <mb...@os.datafx.com.au> wrote:
> >We have a shared hosting platform, and have a requirement to allow php
> >scripts to create directories+files - Problem is that php is run under
> >apache user (www-data), and the users directories are owned by the
> >user, so php script is getting permission denied...We could chmod 777
> >on the directory, but I was hoping there was a more secure alternative?

On 22.08.06 18:03, Joshua Slive wrote:
> Two options:
> 
> 1. Run php as a CGI under suexec.
> 
> 2. Give ownership of the relevant directories to www-data and use
> php's safe mode.  (But be sure to recognize its limitations.)

3. run with umask 002 and allow writing to group apache runs as, relax
safe_mode checking to GID.

4. use PHP's FTP commands - php scripts will log via FTP and create
directories and upload files.

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
- Have you got anything without Spam in it?
- Well, there's Spam egg sausage and Spam, that's not got much Spam in it.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Allow php scripts to create directories+files..

Posted by Joshua Slive <jo...@slive.ca>.
On 8/22/06, mb2@os.datafx.com.au <mb...@os.datafx.com.au> wrote:
> Hi,
>
> We have a shared hosting platform, and have a requirement to allow php
> scripts to create directories+files - Problem is that php is run under
> apache user (www-data), and the users directories are owned by the
> user, so php script is getting permission denied...We could chmod 777
> on the directory, but I was hoping there was a more secure alternative?

Two options:

1. Run php as a CGI under suexec.

2. Give ownership of the relevant directories to www-data and use
php's safe mode.  (But be sure to recognize its limitations.)


Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org