Image Upload functionality not working on my droplet


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

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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