FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

chmod() [this is massivly important!!!!]

 


m-productions
I did a search on this, but I got a bunch of topics that didnt apply to me, so if this is out there, im sorry.

I got this error when running the following script.

Code:
Code:
<?php
//create the directory if doesn't exists (should have write permissons)
if(!is_dir("./files")) mkdir("./files", 0777);
//move the uploaded file
move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']);
chmod("./files/".$_FILES['Filedata']['name'], 0777);
?>



My error

Code:
Warning: chmod() [function.chmod]: Operation not permitted in /home/mproduct/domains/m-productions.us/public_html/beta/upload.php on line 6



I posted this in the php section, but im now thinking this has somethign to do with the hosting itself.


Last edited by m-productions on Thu Jun 14, 2007 2:16 am; edited 1 time in total
mathiaus
Go to the file manager in DA and check who the owner of the file is. If its not you (ie. Apache), there should be a link in the same row to change ownership to yourself.
m-productions
Edit: well yes it seems apche is taking over ALL MY FILES! this is bad, how do i make it so that files made with a php script, or copied or w/e are not taken over by apache,


Turns out, this is a MASSIVE problem, I cant even add folders or files myself unless i got set the folder to my ownership... please, is there anyway to make apache not be so lame? I understand that "apache is running the scripts" so it takes ownership of the files.. but is there a way to make this not happen.
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.