hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Not chmodding. Please help
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

Not chmodding. Please help

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-07-2004, 11:58 PM
Doh004 Doh004 is offline
Web Hosting Guru
 
Join Date: Jan 2004
Location: NJ, USA
Posts: 288

Not chmodding. Please help


Aight I'm having a problem. I'm making a directory from a $_POST and it's protected and all, however once it is created, the proper CHMOD isn't correct, nor even any number at all, it's set to 0.

I've tried: mkdir($_POST['username'] , 0777);

I've also tried:
mkdir($_POST['username']);
chmod($_POST['username'] , 0777);

AND system(chmod 0777 , $_POST['username']);

And I can't even change the created directory through FTP. Please help.

__________________


Reply With Quote


Sponsored Links
  #2  
Old 09-08-2004, 12:47 AM
alex_ch alex_ch is offline
New Member
 
Join Date: May 2003
Posts: 4
set corresponding umask before you create a dir
if you need 0x777, then
umask(0000);
mkdir('ur_dir', 0777);

that can help

Reply With Quote
  #3  
Old 09-08-2004, 12:59 AM
Doh004 Doh004 is offline
Web Hosting Guru
 
Join Date: Jan 2004
Location: NJ, USA
Posts: 288
Wow this is seriously messed up:

Warning: mkdir(artic): Permission denied in /home/virtual/site3/fst/home/myimg/public_html/functions.php on line 106

So basically I can't do jack? I own the server and administer everyhitng, how could this be???

__________________


Reply With Quote
Sponsored Links
  #4  
Old 09-08-2004, 02:49 AM
Burhan Burhan is offline
Community Guide
 
Join Date: Jul 2003
Location: Kuwait
Posts: 5,100
It means that Apache doesn't have the proper rights to change permissions. If you chown the files to the apache user, the permission errors should go away.

__________________
In order to understand recursion, one must first understand recursion.
If you feel like it, you can read my blog
Signal > Noise

Reply With Quote
  #5  
Old 09-08-2004, 07:17 AM
EXOWorks EXOWorks is offline
Web Hosting Evangelist
 
Join Date: Nov 2002
Posts: 510
is the directory /home/virtual/site3/fst/home/myimg/public_html/ chmoded to 0777 ?

and the php is compiled as an apache module right ??

__________________
Get help with your server optimization - A forum on server optimization...
ExoPHPDesk - Powerful PHP HelpDesk

Reply With Quote
  #6  
Old 09-08-2004, 10:03 AM
Doh004 Doh004 is offline
Web Hosting Guru
 
Join Date: Jan 2004
Location: NJ, USA
Posts: 288
Quote:
Originally posted by Mike_R
is the directory /home/virtual/site3/fst/home/myimg/public_html/ chmoded to 0777 ?

and the php is compiled as an apache module right ??
Yes and I believe so.

__________________


Reply With Quote
  #7  
Old 09-08-2004, 01:46 PM
Doh004 Doh004 is offline
Web Hosting Guru
 
Join Date: Jan 2004
Location: NJ, USA
Posts: 288
Um my webhost guy says when php creates a folder, it goes to the root account permissions. So only the root account can change the CHMOD on it. I don't get it. I mean wtf is the point of mkdir() if you can't set the permissions correct if you are using a user....

__________________


Reply With Quote
  #8  
Old 09-08-2004, 02:11 PM
tuxguru tuxguru is offline
Disabled
 
Join Date: Aug 2004
Location: India
Posts: 48
What is the uid and gid of the directory that was created?

Reply With Quote
  #9  
Old 09-08-2004, 02:23 PM
Doh004 Doh004 is offline
Web Hosting Guru
 
Join Date: Jan 2004
Location: NJ, USA
Posts: 288
I'm sorry but whats a uid and gid?

If your asking this account isn't the root directory.

__________________


Reply With Quote
  #10  
Old 09-15-2004, 10:59 AM
tuxguru tuxguru is offline
Disabled
 
Join Date: Aug 2004
Location: India
Posts: 48
That's the user and group of the directory. You can find this by:
Code:
ls -ld /path/to/dir

Reply With Quote
  #11  
Old 09-15-2004, 03:44 PM
Doh004 Doh004 is offline
Web Hosting Guru
 
Join Date: Jan 2004
Location: NJ, USA
Posts: 288
What difference will this do? This acconut is the root account

__________________


Reply With Quote
  #12  
Old 09-16-2004, 11:04 PM
tuxguru tuxguru is offline
Disabled
 
Join Date: Aug 2004
Location: India
Posts: 48
But, since you are executing the php script via apache, then the php won't be running as root.

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?