Re: Permission denied

From: Date: Fri, 23 Mar 2001 14:59:33 +0000
Subject: Re: Permission denied
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-45288@lists.php.net to get a copy of this message
Don't forget, PHP (in general) runs as the webserver (normally "nobody" or "apache" for Apache servers). Make sure your webserver has write access to /home/jalmberg/public_html/qiksys/images/ adamw ----- Original Message ----- From: "John Almberg" <jalmberg@identry.com> To: "PHP General List" <php-general@lists.php.net> Sent: Friday, March 23, 2001 2:50 PM Subject: [PHP] Permission denied > Hi all, > > I'm trying to upload a file from a client browser to my server. > > On the client side, I've got: > > <FORM ENCTYPE="multipart/form-data" ACTION="upload.php" METHOD=POST> > <!-- <INPUT TYPE="hidden" name="MAX_FILE_SIZE" > value="1000"> --> > Send this file: <INPUT NAME="userfile" TYPE="file"> > <INPUT TYPE="submit" VALUE="Send File"> > </FORM> > > On the server side, I've got: > > echo ("$userfile<br>"); > echo ($HTTP_POST_FILES['userfile']['name'] ."<br>"); > echo ($HTTP_POST_FILES['userfile']['type'] ."<br>"); > echo ($HTTP_POST_FILES['userfile']['size'] ."<br>"); > echo ($HTTP_POST_FILES['userfile']['tmp_name'] ."<br>"); > > if (move_uploaded_file($userfile, > "/home/jalmberg/public_html/qiksys/images/temp.jpg")) > print("moved file"); > else > print("couldn't move file!"); > > When I try to use this, I get: > > ============================= > /tmp/phpa21470 > test.jpg > image/pjpeg > 21917 > /tmp/phpa21470 > > Warning: Unable to create > '/home/jalmberg/public_html/qiksys/images/temp.jpg': Permission denied in > /home/jalmberg/public_html/qiksys/upload.php on line 57 > > Warning: Unable to move '/tmp/phpa21470' to > '/home/jalmberg/public_html/qiksys/images/temp.jpg' in > /home/jalmberg/public_html/qiksys/upload.php on line 57 > couldn't move file! > ============================== > > I check the php.ini file and safe mode is turned off. I've also tried with a > text file, same result. I have permission to access the above directory . . > . the php files working this magic are located in > /home/jalmberg/public_html/qiksys. > > Probably there is a simple answer to this question, but I'm out of ideas! > Any help??? > > Thanks in advance. > > John > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#45288) next »