Web Hosting Talk







View Full Version : PHP mkdir();


W-H-Mtl
03-28-2003, 04:18 PM
I have made myself a set of input forms in PHP that
allow me to populate a database and create directories
in my site.

My problem now is, after moving the site from my PC
to my domain, I keep getting error messages telling
that I (or more specifically Mr.PHP aka nobody) don't
have the necessary permissions to create a directory.

I've been trying to add the user nobody to my group,
with no avail. I'm on a linux system running apache.
Any Ideas?

Setting the site's folder to 777 works.... but it's not
a good practise :(

CSD_Hosting
03-28-2003, 06:45 PM
u need to chown it to 'nobody'

jb4mt
03-29-2003, 11:22 AM
First of all, as you note changing permissions to 777 is not good practice. But you don't have to be so extreme. All that other users need to browse and change directories is execute permission.

So chmod 755 might work. You can do this recursively for an entire directory and all it's subdirectories with the -R option.

rusko
03-29-2003, 05:02 PM
use cgi with suexec for this.

JustinH
03-30-2003, 02:59 PM
Originally posted by CSD_Hosting
u need to chown it to 'nobody'

And then everyone with PHP access on the server has complete read, write and execute privs on the folder. Not a good idea. I'd agree using CGI and SuExec would be the best bet.