CHMOD permissions - grrrr!!

locateMe

Verified User
Joined
Feb 12, 2004
Messages
44
I have a problem getting to grips with file permissions and hope someone can point me in the right direction.

I have a PHP script that creates a folder on the server and then uploads a couple of files to it (it's an admin function in the web site).

I have moved the site to our new server but when I try and run the admi script (which uses mkdir(full_directory_path) I get permission denied. By default the main folder is 755 and I have tried all combinations up to 777 but of course I don't think it likes a 777 anway.

The actual error message is

Warning: mkdir(/home/p900themes/domains/p900themes.com/public_html/themes/designs/Cartoons/homertrix): Permission denied in /home/p900themes/domains/p900themes.com/public_html/themes/addthemes.php on line 83

Can anyone suggest why the script cannot create new folders and files?

Many thanks

Steve
 

Peter

Verified User
Joined
Jan 15, 2004
Messages
97
Do chown yourusername thefolderyouwanttoown...
That should work...
 

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
8,961
Hello,

The script is run as apache, which doesn't have write permission on a directory not owned by apache. But i don't see why 777 wouldn't work.

John
 

locateMe

Verified User
Joined
Feb 12, 2004
Messages
44
Got it!

Thanks for your help and it's now working

The apache owner is actually called "103" which is what confused me rather than apache and having set permissions to 777 I can now chown then as "103" with the desired effects and then CHMOD back to 755 for security

Your advice was spot on and greatly appreciated.

Steve
 
Top