0

I have been noticing of late, after I upload my sites to a different server, I seem to have some sort of upload problem

  1. Once I have copied and moved site using FTP to a new host I then can not upload new plugins through wp-admin because I get:

    Could not create directory.),

  2. I can't upload media on posts or pages because I get:

    Unable to create directory wp-content/uploads/2014/08

    Is its parent directory writable by the server?

  3. I also noticed that at the bottom of wp-admin/theme-editor.php there is a message that says:

    "You need to make this file writable before you can save your changes. See the Codex for more information."

I don't have this message on the version of the site on my development hosting server and I don't get any of these error messages either. It is odd, because I just copied the sites as is from one server and moved them to another, and used the search and replace script to change paths.

This has happened to me recently with 3 different sites using 3 different hosts. What's also odd in all these cases, the folder permissions on the uploads and wp content folders are set to 755.

What am I missing and how do I fix this problem?

5 Answers 5

1

First issue is related with ownership of the directory. Second issue is, you will have to make directory within directory so consider using following UNIX command:

sudo mkdir -p wp-content/uploads/2014/08

here p flag lets you create directory within directory Third issue is related with the file permissions ( theme-editor.php) use :

ls -lah 

to view the ownership and permissions of the file. or consider following code to change the permission of file

sudo chmod 755 theme-editor.php

and then try to do whatever you want to do with files. I hope it helps.

0

This could be problem with file permissions and ownership on server. If you have SSH privilege on your server (if you are on VPS or on dedicated server) open SSH connection, navigate to your home folder, usually like this if you are on cPanel:

cd /home/username/public_html

and type this to change owner of files

chown -R username *

or to change group too

 chown -R username:group *

("username" is your current username on server probably same as in path to your local foder)

If that does not help you will need to change your PHP handler to suPHP, or FastCGI...

If you are on shared hosting only thing you can do is to contact your hosting provider and ask them to do that for you, and also if you are on managed VPS/dedicated server you can use this option too.

0

Here is the actual solution!

Go to Settings > Media. If you have the same issue as me, under uploading files, something has changed the default upload folder to something like this:

/home5/something/something/uploads/sitename/2014/08/etc/etc

I then set upload folder to the default which is

wp-content/uploads

And voila! Fixed.

As a cleanup, I connected to server and deleted the folder referenced by:

/home5/something/something/uploads/sitename/2014/08/etc/etc

Which was empty I might add.

0

If it's not a file permision problem, look inside the wp_options table and delete the "upload_path" option if exists or change the destination directory.

-2

First go to wp-content folder of your website

#if upload folder doesn't exists
mkdir uploads
#then grant all the permission to it
sudo chmod 0777 uploads
1
  • Bad answer; 777 permissions will get you hacked. Commented Nov 10, 2016 at 4:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.