|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
mkdir possible under safe mode?
I am trying to create dirs for storing photo-albums per directory. I can create these with mkdir(). But i am not able to access the dirs. I get the message "script with UID 1234 cannot acces dir which is owned by UID 12".
How can I circumvent this problem? (except ftp_mkdir which only shifts the problem: the dir is then owned by the ftp user) |
|
#2
|
||||
|
||||
|
i believe that you may have to give your script write access, and also make sure write acces is enabled for the directory you are making the directories in.
If that doesnt work then i am not sure. Also, i am not really sure about the safemode question |
|
#3
|
|||
|
|||
|
I'm not sure about the safe_mode issue either but if you need to change permissions on a folder or a file you can use the chmod() function.
After you have created the directory use it like this: PHP Code:
Be sure to set the second parameter to whatever permissions you want. mkdir() automatically sets permissions open to everybody but since that's not working maybe this will. |
|
#4
|
||||
|
||||
|
mkdir should work fine under safe mode. If its not, some other issue is at hand.
__________________
Give a person code, and they'll hack for a day; Teach them how to code, and they'll hack forever. Analyze twice; hack once. The world's first existential ITIL question: If a change is released into production without a ticket to track it, was it actually released? About DrGroove: ITIL-Certified IT Process Engineer - Enterprise Application Architect - Freelance IT Journalist - Devshed Moderator - Funk Bassist Extraordinaire |
|
#5
|
|||
|
|||
|
thanks for the response
PHP seems to be a little inconsistent here. When I make a directory via telnet the script may access that dir, despite it is not the owner. But when httpd is the owner, permissions doesn't seem to matter anymore and safe mode comes in to frustrate me. I don't understand, but it looks like as if mkdir() isn't available for me... |
|
#6
|
|||
|
|||
|
the total picture is like this:
I have a directory "albums" of which I am the owner and the permission are 777 the script is to make a directory "1234" in albums. So it does. With chmod I change the permissions to 777. Then I've got "albums/1234". "1234" is owned by httpd. Then in the NEXT LINE OF CODE, i want to make a dir "thumbnail" in "1234", this would result in "albums/1234/thumbnail". But this line (mkdir("../albums/1234/thumbnail",0755) fails because the script is not the owner of "1234". While the line before it created a subdir ("1234") in a dir ("albums") of which the script wasn't the owner neither!! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > mkdir possible under safe mode? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|