Wordpress plugin install: Could not create directo

2020-05-21 08:06发布

I'm using WordPress on centos 6.

I try to install a plugin. But I got this error:

Installing Plugin: bbPress 2.5.9 Downloading install package from https://downloads.wordpress.org/plugin/bbpress.2.5.9.zip

Unpacking the package…

Could not create directory.

How can I resolve this?

P/S: I run this command:

sudo -u root touch /var/www/html/wordpress/wp-content/plugins/test.txt

and it works. But I still get that error.

15条回答
霸刀☆藐视天下
2楼-- · 2020-05-21 08:39

You can fix this by using the following commands. You should first be in the root folder of Wordpress.

sudo chown -R www-data:www-data wp-content/plugins/
sudo chmod 775 wp-content

sudo chown -R www-data:www-data wp-content/
查看更多
放我归山
3楼-- · 2020-05-21 08:39

Absolutely it must be work!

  • Use this chown -Rf www-data:www-data /var/www/html
查看更多
贪生不怕死
4楼-- · 2020-05-21 08:40

You only need to change the access permissions for your WordPress Directory:

chown -R www-data:www-data your-wordpress-directory
查看更多
趁早两清
5楼-- · 2020-05-21 08:49

If anyone using shared hosting and get same problem it may be disk space issue. In that case contact with your hosting support and ask them to increase disk space of your acocunt.

查看更多
手持菜刀,她持情操
6楼-- · 2020-05-21 08:49

To solve permission issue on ubuntu server, you just run this

sudo chmod 777 -R 'wordpress wp-content file location' 

for example.

sudo chmod 777 -R /usr/share/wordpress/wp-content
查看更多
Bombasti
7楼-- · 2020-05-21 08:50

The user that is running your web server does not have permissions to write to the directory that Wordpress is intending to create the plugin directory in. You should chown the directory in question to the user that is running Wordpress. It is most likely not root.

In short, this is a permissions issue. Your touch command is working because you're using it as root, and root has global permissions to write wherever it wants.

查看更多
登录 后发表回答