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 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
"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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
|
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...
| |