Jump to content

Going crazy, n00b problem...


EricgTP313

Recommended Posts

So I have several scripts to upload images, they all worked. Now I'm moving all my sites to a dedicated server with CentOS, Apache 2.0.52, and PHP 4.3.9.

 

I've set all the permissions I can think of to the directories being uploaded to, I've chown'd them for apache:apache, and also nobody. I have no idea why I'm having this problem...

 

Script (real basic one i wrote just to make sure i hadnt broke something in my old scripts)

<?
if($_SERVER['REQUEST_METHOD'] == "POST") { 
$theDir = "/images/";
$theNewFile = $_FILES[theFile][name];
echo $_FILES[theFile][name];
echo "<br>";
echo $_FILES[theFile][tmp_name];
move_uploaded_file($_FILES[theFile][tmp_name],$theDir.$theNewFile);
die();
}
?>

 

the output:

 

akita-eric.jpg
/tmp/php0bvwGa
Warning: move_uploaded_file(/images/akita-eric.jpg): failed to open stream: No such file or directory in /var/www/websites/<username>/testme.php on line 16

Warning: move_uploaded_file(): Unable to move '/tmp/php0bvwGa' to '/images/akita-eric.jpg' in /var/www/websites/<username>/testme.php on line 16

 

Somebody please help, this is driving me nuts, and is a pretty integral part of many of my websites, the ability to upload via http....

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/55916-going-crazy-n00b-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.