Upgrade WordPress permissions error message: cannot create directory copy file installation failed requires ftp

Error message when upgrading WordPress permissions:

Failed to create directory copy file installation failed requires ftp

When we first install WordPress, or after migrating our WordPress website to a different hosting provider , and want to upgrade WordPress plugins , programs, or themes, we often encounter these common problems:

  1. Error: wordpress upgrade failed to create directory.installation failed
  2. vsftpd cannot create directory
  3. wordpress cannot install theme
  4. Updating translations for wordpress en_cn Failed to create table of contents
  5. wordpress installation failed unable to copy files
  6. wordpress cannot copy file
  7. wordpress update permissions
  8. wordpress theme installation failed unable to copy files
  9. Installation failed Failed to find wordpress content directory wp content
  10. To perform the requested action, WordPress needs permission to access your web server.Please enter your FTP login credentials to continue.If you forget your login credentials (eg username, password), please contact your web host.

The reason why WordPress will have the above problems is usually caused by incorrect permission settings:

  • FTP users have permissions, but Web users do not necessarily have permissions.

It is not recommended to set 777 permissions

For example: WordPress installation plugin prompts "Cannot create directory", which is caused by directory permission settings.

Under normal circumstances, you can directly set 777 permissions to these directories ▼

  1. / wp-content / plugins
  2. / Wp-content / themes
  3. / wp-content / uploads
  4. /wp-content/upgrade

However, this will result in insufficient server security. If the website is compromised, it will be very detrimental to SEO ranking, so it is not recommended that you do this.

Chen Weiliang suggests you use the following better solution.

SSH set 775 permissions

If you are using a VPS, the default owner of these directories is root, the FTP server used is vsftpd, and the server is Apache2.

These conditions mainly restrict the default user group names.

If the Linux system you are installing is different, you may need to adjust the user group name.

The following is the SSH setting 775 permission process ▼

Step 1: Log in via SSH

Step 2: Navigate to the /wp-content/ directory ▼

cd /home/admin/web/你的域名文件夹/public_html/wp-content/

Step 3: Set 755 permissions to these directories, that is, only the owner has permission to write ▼

chmod -R 755 plugins/
chmod -R 755 themes/
chmod -R 755 uploads/
chmod -R 755 upgrade/

VestaCPChange folder permissions

If you have installed the VestaCP panel , you can use the following command to quickly modify the permissions of your WordPress website directory ▼

chown -R admin:admin /home/admin/web/你的域名文件夹/public_html/*

HestiaCPChange folder permissions

HestiaCP quickly modifies the permissions of the WordPress website directory

chown -R 你的用户名:你的用户名 /home/你的用户名/web/你的域名文件夹/public_html/*

CWP Control PanelSet 755 permissions

If your VPS is installed with the CWP control panel, please log in directly to the background of the CWP control panel to set permissions.

Step 1: Go to the Fix Permissions page

  • CWP menu –> User Accounts –> Fix Permissions (fix permissions and select user)

Step 2: Select your users ▼

Upgrade WordPress permissions error message: cannot create directory copy file installation failed requires ftp

Step 3: Click Fix Account Permissions ▲

  • CWP control panel setting 755 permissions is really simple and fast ^_^

Update wp-config.php file

If the above method does not work, or you are using a virtual host instead of a VPS, then the above setting method may not be applicable.

Please add the following code before the line "That's it, stop editing! Happy publishing." in the wp-config.php file: ▼

define("FS_METHOD","direct");
define("FS_CHMOD_DIR", 0755);
define("FS_CHMOD_FILE", 0755);

Basically doing this will make your WordPress program both more secure and able to upgrade.

To successfully complete your online marketing tasks, you can now start testing, installing, and upgrading various online promotion plugins. ^_^

Comment

Your email address will not be published. Required fields are marked with * .

Scroll to Top