473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

move_uploaded_file Permission denied

Hi

I am moving a site to a new server, I have been testing it
and one of the pages uses move_uploaded_file, but I
get a Permission denied.

The directory I am moving it to is chomd of 755, if I
change it to 777 it does upload but the owner is www-data,
but I then can't download it using a FTP client (which I have to do)
as it's the wrong owner, so I have to leave the chomd as 755, but
this point to being a server config problem, any ideas?

the errors I am getting is

Warning: move_uploaded_file(THE_PATH/1128467274.jpg): failed to open stream:
Permission denied in /var/www/vhosts/domain.com/httpdocs/login/library.php
on line 157

Warning: move_uploaded_file(): Unable to move '/tmp/phpptQSmo' to
'THE_PATH/1128467274.jpg' in
/var/www/vhosts/domain.com/httpdocs/login/library.php on line 157

Oct 5 '05 #1
2 16234
Brian wrote:
Hi

I am moving a site to a new server, I have been testing it
and one of the pages uses move_uploaded_file, but I
get a Permission denied.

The directory I am moving it to is chomd of 755, if I
change it to 777 it does upload but the owner is www-data,
but I then can't download it using a FTP client (which I have to do)
as it's the wrong owner, so I have to leave the chomd as 755, but
this point to being a server config problem, any ideas?

the errors I am getting is

Warning: move_uploaded_file(THE_PATH/1128467274.jpg): failed to open
stream: Permission denied in
/var/www/vhosts/domain.com/httpdocs/login/library.php on line 157

Warning: move_uploaded_file(): Unable to move '/tmp/phpptQSmo' to
'THE_PATH/1128467274.jpg' in
/var/www/vhosts/domain.com/httpdocs/login/library.php on line 157


Hi

SO targetdirectory has:
755
rwxr-xr-x
That says that ONLY the owner of the directory can write there.
You didn't give others (like www-data) to write in that directory.
You probably ment 766 or 764 or something depending on the fact if www-data
has a group you are in.

Solutions:
- change permissions to 766 or something
- Make www-data the owner of the folder where you are moving files to.

Regards,
Erwin Moller
Oct 5 '05 #2

"Erwin Moller"
<si******************************************@spam yourself.com> wrote in
message news:43***********************@news.xs4all.nl...
Brian wrote:
Hi

I am moving a site to a new server, I have been testing it
and one of the pages uses move_uploaded_file, but I
get a Permission denied.

The directory I am moving it to is chomd of 755, if I
change it to 777 it does upload but the owner is www-data,
but I then can't download it using a FTP client (which I have to do)
as it's the wrong owner, so I have to leave the chomd as 755, but
this point to being a server config problem, any ideas?

the errors I am getting is

Warning: move_uploaded_file(THE_PATH/1128467274.jpg): failed to open
stream: Permission denied in
/var/www/vhosts/domain.com/httpdocs/login/library.php on line 157

Warning: move_uploaded_file(): Unable to move '/tmp/phpptQSmo' to
'THE_PATH/1128467274.jpg' in
/var/www/vhosts/domain.com/httpdocs/login/library.php on line 157


Hi

SO targetdirectory has:
755
rwxr-xr-x
That says that ONLY the owner of the directory can write there.
You didn't give others (like www-data) to write in that directory.
You probably ment 766 or 764 or something depending on the fact if
www-data
has a group you are in.

Solutions:
- change permissions to 766 or something
- Make www-data the owner of the folder where you are moving files to.

Regards,
Erwin Moller


It turns out it was a little more than just basic permissions, it was to do
with
the nut and bolts of the server, think I have it sorted now, thanks for your
response

Brian
Oct 6 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mark E. Hamilton | last post by:
Sorry, I probably should have re-stated the problem: We're using Python 2.3.5 on AIX 5.2, and get the follow error messages from some of our code. I haven't yet tracked down exactly where it's...
2
by: Taishi | last post by:
New user of SQL Everything is on the same machine My error is close to the bottom After reading it today, I can see there is a problem with 2 dbases 'PUBS' and 'Master' There are also some...
0
by: debug03 | last post by:
I am executing a DTS package on a Windows 2000 sp4 server running SQL Server 2000 and IBM DB2 V7 client. The DTS package source data(SQL Server) is selected from SQL server table and inserts data to...
6
by: Andy2500 | last post by:
Hi, I'd like to upload an image to a folder, then I have 3 diffrents examples but all of them give an error "failed to open stream: Permission denied", althrough the C:\Inetpub\wwwroot is not...
0
by: private.anders | last post by:
Hi David! Really need assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
0
by: private.anders | last post by:
Really need your assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
4
by: xzzy | last post by:
I have a v1.1 web app that works on my local computer. However, running it at the host computer, the following breaks: when a viewer selects a different country, the State dropdown should...
6
by: vinpkl | last post by:
hi all i am uploading an image on live linux hosting server and getting the below error Warning: move_uploaded_file(../graphics/home_bigad2.jpg) : failed to open stream: Permission denied in...
3
by: unauthorized | last post by:
I'm running a PHP 5.1 on an Apache 2.2 server under Windows XP which I use to develop my web apps. Currently, I am trying to add "upload" functionality to my project, but for some reason, when the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.