最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

server - Permissions working but not working

programmeradmin6浏览0评论

Not sure what I changed in my Wordpress some days ago but today I was not able to update/install any plugin. I followed and applied the following permissions:

sudo find ~/apps/wordpress/htdocs/ -type f -exec chmod 644 {} \;
sudo find ~/apps/wordpress/htdocs/ -type d -exec chmod 755 {} \;

sudo chmod 750 ~/apps/wordpress/htdocs/wp-config.php
sudo find ~/apps/wordpress/htdocs/wp-content -type d -exec chmod 775 {} \;
sudo find ~/apps/wordpress/htdocs/wp-content -type f -exec chmod 664 {} \;
sudo chmod 750 ~/apps/wordpress/htdocs

sudo chown -R bitnami:daemon ~/apps/wordpress/htdocs
sudo chown -R bitnami:daemon ~/apps/wordpress/htdocs/wp-content/plugins
sudo chown -R bitnami:bitnami ~/apps/wordpress/htdocs/wp-content/upgrade
sudo chown -R daemon:daemon ~/apps/wordpress/htdocs/wp-content/uploads

Now I CAN update and install plugins but:
- It takes longer, roughly twice as much time than some days ago (before it broke).
- It tells me the install/update was unsuccesful even though it did it!

The update cannot be installed because we were unable to copy some files. This is usually due to inconsistent file permissions.

Of course, it is not that bad, but I would like to have it as it should be, not with such a result.
Any idea?

Not sure what I changed in my Wordpress some days ago but today I was not able to update/install any plugin. I followed https://community.bitnami/t/wordpress-permissions-unable-to-create-directory/42048/3 and applied the following permissions:

sudo find ~/apps/wordpress/htdocs/ -type f -exec chmod 644 {} \;
sudo find ~/apps/wordpress/htdocs/ -type d -exec chmod 755 {} \;

sudo chmod 750 ~/apps/wordpress/htdocs/wp-config.php
sudo find ~/apps/wordpress/htdocs/wp-content -type d -exec chmod 775 {} \;
sudo find ~/apps/wordpress/htdocs/wp-content -type f -exec chmod 664 {} \;
sudo chmod 750 ~/apps/wordpress/htdocs

sudo chown -R bitnami:daemon ~/apps/wordpress/htdocs
sudo chown -R bitnami:daemon ~/apps/wordpress/htdocs/wp-content/plugins
sudo chown -R bitnami:bitnami ~/apps/wordpress/htdocs/wp-content/upgrade
sudo chown -R daemon:daemon ~/apps/wordpress/htdocs/wp-content/uploads

Now I CAN update and install plugins but:
- It takes longer, roughly twice as much time than some days ago (before it broke).
- It tells me the install/update was unsuccesful even though it did it!

The update cannot be installed because we were unable to copy some files. This is usually due to inconsistent file permissions.

Of course, it is not that bad, but I would like to have it as it should be, not with such a result.
Any idea?

Share Improve this question asked Dec 24, 2019 at 14:18 AdrihinAdrihin 334 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

Make sure the user running on behalf of the webserver's PHP process has ownership permissions on /path/to/wordpress

Example

For Ubuntu 18.04 running Apache2

# Go to wordpress installation root directory
cd /path/to/wordpress

# Give ownership to Apache2's PHP process
sudo chown www-data:www-data .

# Apply files and directories permissions
sudo find . -type f -exec chmod 664 {} +
sudo find . -type d -exec chmod 775 {} +
sudo chmod 644 wp-config.php

It works now. For those wondering, there was something wrong with the symlinks so I just went back to the original WP permissions.

sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/
sudo find /opt/bitnami/apps/wordpress/ -type f -exec chmod 664 {} \;
sudo find /opt/bitnami/apps/wordpress/ -type d -exec chmod 775 {} \;
sudo chmod 640 /opt/bitnami/apps/wordpress/htdocs/wp-config.php

I semi-modified the answer from here: https://community.bitnami/t/cant-update-wordpress-plugin/72068/6

发布评论

评论列表(0)

  1. 暂无评论