PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 20th, 2003, 10:35 AM
twbon twbon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Amsterdam
Posts: 8 twbon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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)

Reply With Quote
  #2  
Old August 20th, 2003, 12:44 PM
rkelley's Avatar
rkelley rkelley is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Oklahoma
Posts: 159 rkelley User rank is Private First Class (20 - 50 Reputation Level)rkelley User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
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

Reply With Quote
  #3  
Old August 20th, 2003, 01:30 PM
Pahikua Pahikua is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 31 Pahikua User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 46 sec
Reputation Power: 7
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:
 chmod($path_to_dir0744); 


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.

Reply With Quote
  #4  
Old August 20th, 2003, 01:31 PM
drgroove's Avatar
drgroove drgroove is offline
pushing envelopes, not pencils
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Feb 2002
Posts: 6,227 drgroove User rank is Captain (20000 - 30000 Reputation Level)drgroove User rank is Captain (20000 - 30000 Reputation Level)drgroove User rank is Captain (20000 - 30000 Reputation Level)drgroove User rank is Captain (20000 - 30000 Reputation Level)drgroove User rank is Captain (20000 - 30000 Reputation Level)drgroove User rank is Captain (20000 - 30000 Reputation Level)drgroove User rank is Captain (20000 - 30000 Reputation Level)drgroove User rank is Captain (20000 - 30000 Reputation Level)drgroove User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Day 4 h 51 m 18 sec
Reputation Power: 258
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


Reply With Quote
  #5  
Old August 20th, 2003, 02:16 PM
twbon twbon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Amsterdam
Posts: 8 twbon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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...

Reply With Quote
  #6  
Old August 20th, 2003, 02:25 PM
twbon twbon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Amsterdam
Posts: 8 twbon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > mkdir possible under safe mode?


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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





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