|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
creating directory
Hi guys,
i tried to create a folder in my webhosting server by using this code: //code from line 27 mkdir("/home/myweb/public_html/members/$web_add", 0777) or die("Unable to create directory"); mkdir("/home/myweb/public_html/members/$web_add/images", 0777) or die("Unable to create directory"); but there is an error occured.. error: Warning: mkdir(/home/myweb/public_html/members/myadd1): Permission denied in /home/myweb/public_html/wec_cart/wc_admin/activate.php on line 27 Unable to create directory Can somebody tell me whats wrong with my code, please advise.. thanks |
|
#2
|
||||
|
||||
|
What user has ownership of /home/myweb/public_html/members? The www user or group (sometimes "nobody," sometimes "apache," sometimes something else) will need to have write permission on the directory.
|
|
#3
|
|||
|
|||
|
i am quite new in using mkdir function, could u please let me know where can i set the user to nobody like u mentioned ??
thanks.. |
|
#4
|
||||
|
||||
|
This is probably something you'll have to do at the command line or run by your hosting company (if you don't know how to use the command line or don't have shell access). You'd want to tell them something like "I'm trying to have the Web server create a subdirectory in /home/myweb/public_html/members and am getting a permissions error. Could you make sure the Web user or group can write to that directory?"
|
|
#5
|
|||
|
|||
|
First of all, I am sorry for posting my thread here. I didn't mean to steal it. If there is a solution we both have it. This topic is exactly what I was looking for.
I have the same error while running a script that can create directory through form. According to this message: Quote:
I downloaded a program called "4images". I am in admin area, everytime I create a new gallery it automately create a new folder. There is no borther to contact hosting company. I was wondering how they do that. If anyone know the way, please help us. Thank you very much. |
|
#6
|
|||
|
|||
|
I got it figure. Just chmod the root directory as 0777 we be able to create a dir through mkdir() function. But I don't know really much about security when when chmod the root directory. If someone have a better explanation please share with us. Thanks all!
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > creating directory |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|