Wordpress Can not create directory - wordpress

I am trying to upload a new theme to my WordPress site
I get an error "Can not create directory"
Im sure its permissions errors however I cannot figure out what to do.
I have setup a new server (CentOS), I have all the ports open needed for FTP.
I can ftp from a different location through telnet.
My ftp user has full permissions to the directory.
How can i fix this?

From the File Permissions section of Hardening WordPress:
All files should be owned by your user account, and should be writable by you. Any file that needs write access from WordPress should be writable by the web server, if your hosting set up requires it, that may mean those files need to be group-owned by the user account used by the web server process.
/
The root WordPress directory: all files should be writable only by your user account, except .htaccess if you want WordPress to automatically generate rewrite rules for you.
/wp-admin/
The WordPress administration area: all files should be writable only by your user account.
/wp-includes/
The bulk of WordPress application logic: all files should be writable only by your user account.
/wp-content/
User-supplied content: intended to be writable by your user account and the web server process.
Within /wp-content/ you will find:
/wp-content/themes/
Theme files. If you want to use the built-in theme editor, all files need to be writable by the web server process. If you do not want to use the built-in theme editor, all files can be writable only by your user account.
/wp-content/plugins/
Plugin files: all files should be writable only by your user account.
You wouldn't go wrong by reading the entire Hardening WordPress page, really.

Related

Moving backed up Wordpress from subdirectory to root

I have a question regarding moving a backup from http://websitename/subdirectory.com to http://websitename.com.
What is the best approach to do this?
I have the backup from the subdirectory on my pc and currently on the website root there is a clean Wordpress installation.
There are alot of pictures, the Avada theme there and other media files.
If I just copy the files via FTP will it crash or will the URLs be broken afterwards?
This will take a couple of steps to but here is the basic steps required.
Download the database from phpmyadmin (or however you access your sites database).
You should have a .sql file now.
You need to do a search and replace action on the full url for the site in the subfolder to the new location where it will live at the root. Your goal here is to get the subfolder out of every url on your site. Example, your current url is this: https://example.com/subfolder/ - you will need it to be https://example.com/
Save that version of your database as a new file called import.sql.
To be safe, I would create a new database, database user, and database password and import this new version into it. Store these values database name, database user, database password and database hostname. You will need them later.
Plugins
Download all of the plugins from /subfolder/wp-content/plugins/ folder and upload those to the /wp-content/plugins/ folder in your root level fresh install of wordpress.
Themes
Upload your theme to the /wp-content/themes/ folder from your /subfolder/wp-content/themes/ folder.
Uploads
Download everything in the /subfolder/wp-content/uploads/ folder and upload to the /wp-content/uploads/ folder.
Update your wp-config.php
That database that you created and imported your database in Step 1 here, you'll need to update your wp-config.php with the new database name, database user, database password and database host.
The last step here is to upload the wp-config.php to the root file and this will point the site to the new database.
Login to wp-admin
Login to wordpress at the root example.com/wp-admin/. Go to Permalinks settings and save them. Sometimes you have to do that to flush the permalinks and make subpages work.
Test your site
Go the frontend of your site and test everything to make sure that everything is in working order.

Not able to install plugins in Wordpress

I've a wordpress hosted in Rackspace cloud server. The site is working fine. To access the wordpress admin panel i have setup FTP access to the root user. I'm able to access and create files via FTP and the wordpress admin can connect to the server via FTP.
But i'm not able to install new plugins from the wordpress admin panel.I'm getting the following errors.
Downloading install package from https://downloads.wordpress.org/plugin/icon-list.0.3.zip…
Unpacking the package…
Could not create directory.
Return to Plugin Installer
First i thought it was some permission issue. But in the server i've set the permissions 777 to the wordpress project folder.But its still showing the same error.
Is there any configuration change made, to be able to install the wordpress plugins successfully.
Set the write permission for your FTP user.
Read Wordpress file permissions from here Changing_File_Permissions
It's can be also a problem with web hosting configurations. Try the FTP method. Reference here.
Add the following lines in your wp-config.php
define('FS_METHOD', 'ftpext');
define('FTP_USER', 'YOUR FTP LOGIN');
define('FTP_PASS', 'YOUR FTP PASSWORD');
define('FTP_HOST', 'YOUR FTP HOST (without http:// or ftp://)');
define('FTP_SSL', false);
Another way :
Your web server has write permissions, then add this to your wp-config.php file:
define('FS_METHOD', 'direct');
Also, wanted to add that you must NEVER set the wp-content permission or permission of any folder to 777.

Wordpress Domain Mapping, which folder(s) to backup?

It took me a while to get domain mapping working on wordpress. I set it up using debian. I was just wondering which folders I should backup in the event of a server re-install where I can just drag in the saved folders and domain mapping should be working again. Unless I have to go through the steps all over again.
You should backup all user generated files like plugins, themes, and upload files which are all under in the wp-content folder. Also, take care of the wp-config.php which includes the db connect setting of your site and the .htaccess file which contains the server config for your site.

Unable to upload images in WordPress

I am unable to upload image in WordPress.
Error comes out like this:
"Unable to create directory wp-content/uploads/2014/04. Is its parent directory writable by the server? "
How can i change writable permission so that i can upload images properly through word press.
On some installations of WordPress, when I try to download a new theme or plugin or even update an existing plugin, I get the following message:
"To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host."
How can I remove these protection so that I can upload and delete plugins, themes, images without any FTP credentials?
You must access the control panel of your account at your hosting company. Look for File Manager and change the permissions of folder /wp-content/plugins and wp-content/uploads to 755, include sub-folders!

Protecting files within folders on a wordpress site

I have a private wordpress website which is made 'private' with a plugin. Now it asks users to enter a password to view the site. However, if someone has the full link to files that are uploaded on the site, they can download them without any authentication. I managed to prevent a directory listing with .htaccess but files can still be downloaded. Is there a way to prevent downloads unless the user is logged in? Perhaps with .htaccess itself?

Resources