Mordent 0 Report post Posted February 25, 2008 Warning: move_uploaded_file(images/profile/Mordent.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/mordent/public_html/withvalour/edit_image.php on line 42Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpOWVz7o' to 'images/profile/Mordent.jpg' in /home/mordent/public_html/withvalour/edit_image.php on line 42 Any ideas? The code seems fine, as it works a treat when I run it locally (on WAMPServer), but as soon as I try to run it on the server I get this horrid error. I'm guessing some weird permission problem that I have no idea how to get around. Share this post Link to post Share on other sites
yordan 10 Report post Posted February 25, 2008 Just guessing. I would like to give read, write and execute permissons to everybody (user, group and others) to images/profile where the image has to be moved. Give 777 permissions first, then, if it works, try to raise the security level. Share this post Link to post Share on other sites
Mordent 0 Report post Posted February 25, 2008 *facepalm*...for the love of...okay, so there's me thinking that some subdirectories inherited permissions. Works an absolute treat. '757' turned out to be the magic number there.Cheers for pointing out the obvious. I have my little moments. Share this post Link to post Share on other sites
ethergeek 0 Report post Posted February 26, 2008 On my servers I usually just run apache as apache:apache and chown my public html directories to user:apache, chmod it to g+rxs and everything works fine. Share this post Link to post Share on other sites
yordan 10 Report post Posted February 26, 2008 chmod it to g+rxsCorrect, that's also what I do, although the +s permissions could be sometimes dangerous.However, if we are talking about public servers like Xisto, the user can only use ftp clients, so he connot directly access the +s option. And the users which have ssh access here are probably jailed in a rsh sheel, i'm event not sure chmod is allowed in a restricted shell command line. Share this post Link to post Share on other sites
iGuest 3 Report post Posted June 24, 2008 great guys Problem With Move_uploaded_file() I had this problem and 757 sure solved it. But do you know anyways to handle security with this kind of a breach -reply by ulta coder Share this post Link to post Share on other sites