473,756 Members | 5,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

move_uploaded_f ile 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_f ile, 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_f ile(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_f ile(): 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 16298
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_f ile, 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_f ile(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_f ile(): 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************ *************** *************** @spamyourself.c om> 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_f ile, 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_f ile(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_f ile(): 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
4330
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 coming from: sem_trywait: Permission denied sem_wait: Permission denied sem_post: Permission denied
2
3688
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 comments from the group: ---microsoft.public.sqlserver.odbc-- subject: Permission Denied -- Thanks for help guys I was able to find a trial version of the Enterprise Manager.
0
3206
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 the destination table(DB2). I get the following error when the package is executed: The execution of the following DTS Package succeeded: Package Name: PEX2-CopyQualDatatoDB2-UAT Package Description: (null) Package ID:...
6
62762
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 protected. Any suggestions would be helpful, thank you for your time.
0
3405
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 installed same application on another server Win 2003 R2 Std (No Active Directory). On that server I get “Permission denied” using the following code (used to zip folder content).
0
1219
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 installed same application on another server Win 2003 R2 Std (No Active Directory). On that server I get “Permission denied” using the following code (used to zip folder content). set WshShell = server.createobject("wscript.shell")
4
2672
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 repopulate with the new country's state/proviences. Running on the host, the dropdown does not repopulate and says 'Permission Denied', I take this to mean that at the host, a viewer does not have permission to put new items in the State dropdown.
6
1292
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 /home/gads/public_html/vineet/admin/add_special_offer.php on line 12 Warning: move_uploaded_file() : Unable to move '/tmp/phpXjKkp7' to '../graphics/home_bigad2.jpg' in /home/gads/public_html/vineet/admin/add_special_offer.php on line 12
3
7723
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 move_uploaded_file() function is called on it, the following error is generated: Now this error may appear to be simple write permission issue, but the account that is running the service has full r/w permissions to the directory that is supposed...
0
9462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9287
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9886
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9857
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2677
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.