I am not able to upload images in wordpress after I migrated my wordpress website from godaddy to digital ocean

October 22, 2016 173 views
WordPress DigitalOcean Ubuntu

Hey,

I migrated my website from godaddy to now digital ocean Ubuntu version $5 droplet.
I installed everything and site is running via serverpilot help.

This website is on wordpress.
While writing post, when i upload any image, the problem is coming is that I am not able to upload images.

Please help.

2 Answers

Do you have any error displayed when uploading?

There could be any reason.
Maybe it is just permissions. You should have write permission on wp-content for best results.

Follow Step 5/Adjusting the ownership part of WordPress tutorial. Make sure you find right location of WP directory as it could be somewhere else because you use ServerPilot

WordPress is the most popular CMS (content management system) on the internet. It allows you to easily set up flexible blogs and websites on top of a MySQL backend with PHP processing. WordPress has seen incredible adoption and is a great choice for getting a website up and...

Imgur? What it is?

Okay, let me copy paste the content of the error message.

Here it is:

"Unable to create directory uploads/2016/10. Is its parent directory writable by the server?"

  • It says enough, as I thought in initial answer, problem is with permissions.
    E.g. - If owner and group is set to root:root, you will have problem using it as it will not allow you to create new folder and files from web.

    SeverPilot has tutorial on How to Fix Permissions which you should follow to fix your problem.
    Follow it and try to upload image again, it should be working this time.

    If this is not wokring, you can follow link from initial answer but I would first try SeverPilots tutorial.

    • I read it, there i find a code which i used it. But it dint help me yet. :(

      • Do you have any other regular (non-root) user on server? In case you followed Initial Server Set Up tutorial you maybe created new user for you (I will call it sammy).

        What you can try is setting owner to sammy:www-data. Command would be now:

        • sudo chown -R sammy:www-data /srv/users/serverpilot/apps

        In case you didn't created non-root user (sammy), stick with serverpilot user but use www-data group:

        • sudo chown -R sammy:www-data /srv/users/serverpilot/apps

        Even if that doesn't work, go to WordPress tutorial and follow Step 5 - Adjusting the ownership part. Make sure that instead of /var/www/html use actual location of WordPress. It could be installed in /srv/users/serverpilot/apps/wordpress but make sure to check is it really there.

        Good luck with it, I hope you will make it working fast :)

        When you start a new server, there are a few steps that you should take every time to add some basic security and give you a solid foundation. In this guide, we'll walk you through the basic steps necessary to hit the ground running with Ubuntu 16.04.
Have another answer? Share your knowledge.