need help with upload Image using PHP,

Posted October 29, 2014 7.6k views

Hello everyone,
I have some script to upload image to server from PHP, and its works fine in my ubuntu test server but whenever i try to use this scripts on my web server(main server), the progress will be done successfully but the image file was not uploaded on server, i even tried to upload image file just from VPS server but then also failed,
here is scripts

1 comment
  • Like @DarkSaint mentioned, folder permissions are a likely problem. Are you seeing any output in you web server’s error log? If you’re using Apache, that would be /var/log/apache2/error.log

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

This might be better suited to stack overflow.
However you should check the folder permissions for the problematic server.

Cheers :)

  • Hello sir,
    yes i have checked the error logs, and i notice its showing some lines like this

    [Thu Oct 30 05:53:37 2014] [error] [client] PHP Warning:  move_uploaded_file() [0function.move-uploaded-file0]: Unable to move '/tmp/php8mwuCb' to 'wp-content/Images/shop/icons/ic_ishop_009.png' in /var/www/Actions/update-shop-item.php on line 77, referer: http://localhost/panel/updateShopItem/itemID/406

    i don’t understand how do i can fix this kind of error.. well if you guys have some easy solution then i would be thankful for you.

thank you asb and DarkSaint, your answer helped

i just had to give this (chmod 777 /folder/path/) permission and its worked thanks alot guys