Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Problem With Move_uploaded_file(), Permission denied?
Mordent
post Feb 25 2008, 05:08 PM
Post #1


Advanced Member
Group Icon

Group: [HOSTED]
Posts: 194
Joined: 30-June 07
Member No.: 23,045



CODE
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 42

Warning: 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.
Go to the top of the page
 
+Quote Post
yordan
post Feb 25 2008, 05:35 PM
Post #2


Way Out Of Control - You need a life :)
Group Icon

Group: [MODERATOR]
Posts: 1,886
Joined: 16-August 05
Member No.: 7,896



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.
Go to the top of the page
 
+Quote Post
Mordent
post Feb 25 2008, 05:50 PM
Post #3


Advanced Member
Group Icon

Group: [HOSTED]
Posts: 194
Joined: 30-June 07
Member No.: 23,045



*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. wink.gif
Go to the top of the page
 
+Quote Post
ethergeek
post Feb 26 2008, 01:28 AM
Post #4


Premium Member
Group Icon

Group: [HOSTED]
Posts: 393
Joined: 9-March 07
From: Tucson, AZ
Member No.: 20,794



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.
Go to the top of the page
 
+Quote Post
yordan
post Feb 26 2008, 02:16 PM
Post #5


Way Out Of Control - You need a life :)
Group Icon

Group: [MODERATOR]
Posts: 1,886
Joined: 16-August 05
Member No.: 7,896



QUOTE
chmod it to g+rxs

Correct, that's also what I do, although the +s permissions could be sometimes dangerous.
However, if we are talking about public servers like astahost, 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.
Go to the top of the page
 
+Quote Post
Feedbacker
post Jun 24 2008, 02:31 AM
Post #6


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. How To Change The Owner Of A File?(10)


 



- Lo-Fi Version Time is now: 6th July 2008 - 10:25 PM