![]() |
| |||
| mkdir PHP not working Hello, I just moved my website over, and some of my files aren't working (specifically the ones with PHP "mkdir," do you know why my PHP files can't create directories? E.g. ... <? mkdir($_SERVER['DOCUMENT_ROOT'].'/test', 0777) ?> Does anyone have any idea why the command above doesn't work? PHP will not create the folder. Thank you, David |
| |||
| I have learned that PHP runs as a generic user... Can this be changed? I just need to have PHP able to create folders and files in the most secure manner possible, how can I achieve this? Thank you... |
| |||
| Try this instead PHP Code: (777 only if 757 fails) Also, would be more secure to create a subfolder inside the folder where the script is (or another location) where more folders/files will be created instead of the same directory as the script itself. Because we need to grant write access to PHP using 757 instead of the default 755. example: script_folder/script.php script_folder/folders/ (chmod folders to 757 or 777 if 757 fails) Then make the script do as this instead: PHP Code: // Regards, Doug Last edited by dougp; 06-26-2007 at 06:02 AM. |
| |||
| Thank you Thank you very much for your reply. I should have written earlier to this post, but I have figured it out, using a different method to use mkdir. Basically, I turned folder privalges to least possible security, made the folder, than turned security back up high so it could only be edited by the owner (me). I'm not sure why, but as long as PHP had made the folder 757, it could do whatever it wanted with it, but if I made the folder at 757, it couldn't. Oh well. If I do run into future problems, I'll be sure to return to this post and try what you've said. Thank you very much!!! |
![]() |
| Thread Tools | |
| Display Modes | |
| |