Report this

What is the reason for this report?

Image Upload functionality not working on my droplet

Posted on January 10, 2015

**

Hello Team,

** I am facing image upload issue in php on my droplet. I am trying to upload simple image on specific folder, but image dosen’t move. When i execute

var_dump(is_writable(‘/var/www/html/StagingServer/project-name/front-design/images/upload/’)); It retruns true that means upload folder is writable even after that still image not uploaded on that folder

When i execute $path = ‘/var/www/html/StagingServer/project-name/front-design/images/upload/’; var_dump(move_uploaded_file(‘temp_file_name’,$path));

It returns false. So can you please help on this

Thanks and regards Ruchit Patel



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

Hello Team, Finally, I got the solution of my problem, i will post here which is very useful to others developers

###-----------Permission to root folder for image upload issue in ubantu14----------### Execute below command

  1. ps aux | grep apache
  2. groups www-data
  3. chown -R www-data:www-data /var/www/
  4. chmod -R 775 /var/www/
  5. usermod -a -G www-data {YOUR_USER_NAME} WARNING! dont forget -a switch! this way you append new group to existing list and not replace old groups list with new one. Now you have read/write access to files located in apache root dir. And we need to tell apache that new files should be readable/writable to group members
  6. echo umask 002 >> /etc/apache2/envvars
  7. service apache2 restart

Thanks and regards Ruchit Patel

Hello Team There is no message appeared, so what can I do now. Can you please give me helpful suggestions as soon as possible…

Thanks and regards Ruchit patel

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.