PDA

View Full Version : CHMOD permissions - grrrr!!


locateMe
02-17-2004, 09:52 AM
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
02-17-2004, 10:11 AM
Do chown yourusername thefolderyouwanttoown...
That should work...

DirectAdmin Support
02-17-2004, 10:11 AM
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
02-17-2004, 10:40 AM
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