EricgTP313 Posted June 17, 2007 Share Posted June 17, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/55916-going-crazy-n00b-problem/ Share on other sites More sharing options...
LiamProductions Posted June 17, 2007 Share Posted June 17, 2007 Im a nub at PHP But you dont have the <?php at the beginning you have <? Quote Link to comment https://forums.phpfreaks.com/topic/55916-going-crazy-n00b-problem/#findComment-276210 Share on other sites More sharing options...
MasterACE14 Posted June 17, 2007 Share Posted June 17, 2007 thats just shorthand, won't make a difference to his code. Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/55916-going-crazy-n00b-problem/#findComment-276211 Share on other sites More sharing options...
AndyB Posted June 17, 2007 Share Posted June 17, 2007 thats just shorthand, won't make a difference to his code. It certainly will if short tags are not enabled on the server! Quote Link to comment https://forums.phpfreaks.com/topic/55916-going-crazy-n00b-problem/#findComment-276240 Share on other sites More sharing options...
steviez Posted June 17, 2007 Share Posted June 17, 2007 Make sure you image dir is not images/ not /images/, i have had this problem before now Quote Link to comment https://forums.phpfreaks.com/topic/55916-going-crazy-n00b-problem/#findComment-276250 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.