Cannot copy file from TMP folder

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dwhswebhosting
Forum Newbie
Posts: 6
Joined: Mon Jun 12, 2006 6:42 pm

Cannot copy file from TMP folder

Post by dwhswebhosting »

When a file upload script tried to copy the file (using PHP) to copy from /tmp to my folder for further processing. it said cannot open, permission denied

Anyone know what would block such a thing.

This happened right after a server crash but everything seems fine.

I would think php can use the /tmp folder with no problems.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

try move_uploaded_file() instead, that or php user does not have permission to the directory.
dwhswebhosting
Forum Newbie
Posts: 6
Joined: Mon Jun 12, 2006 6:42 pm

Post by dwhswebhosting »

I'm wondering why it worked before the server crash and now it doesn't.

I'm trying to figure out what the server crash could of done to deny permissions for php to the /tmp folder.

Strange stuff....
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Cannot copy file from TMP folder

Post by Christopher »

dwhswebhosting wrote:When a file upload script tried to copy the file (using PHP) to copy from /tmp to my folder for further processing. it said cannot open, permission denied
It does not sound like the permission problem is with your /tmp directory (it rarely is). It sounds like the usual problem that the folder to which you are copying the file. Make sure the user that the webserver is running as has write permission to that folder.
(#10850)
dwhswebhosting
Forum Newbie
Posts: 6
Joined: Mon Jun 12, 2006 6:42 pm

Post by dwhswebhosting »

Great I will try that.. and post back.
dwhswebhosting
Forum Newbie
Posts: 6
Joined: Mon Jun 12, 2006 6:42 pm

Re: Cannot copy file from TMP folder

Post by dwhswebhosting »

arborint wrote:
dwhswebhosting wrote:When a file upload script tried to copy the file (using PHP) to copy from /tmp to my folder for further processing. it said cannot open, permission denied
It does not sound like the permission problem is with your /tmp directory (it rarely is). It sounds like the usual problem that the folder to which you are copying the file. Make sure the user that the webserver is running as has write permission to that folder.
Wow that was it, he had it at 755 but needed 777 for the destination folder.

Image Thanks!
Post Reply