General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 2nd, 2003, 02:00 AM
Alicia Alicia is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 117 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 29 sec
Reputation Power: 6
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

Reply With Quote
  #2  
Old October 2nd, 2003, 07:57 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
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.

Reply With Quote
  #3  
Old October 2nd, 2003, 09:18 PM
Alicia Alicia is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 117 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 30 m 29 sec
Reputation Power: 6
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..

Reply With Quote
  #4  
Old October 3rd, 2003, 08:45 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
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?"

Reply With Quote
  #5  
Old October 8th, 2003, 02:02 PM
wareseeker wareseeker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 71 wareseeker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 7 sec
Reputation Power: 6
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:
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?"

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.

Reply With Quote
  #6  
Old October 8th, 2003, 02:35 PM
wareseeker wareseeker is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 71 wareseeker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 7 sec
Reputation Power: 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!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > creating directory


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT