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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.