Domanda

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.com/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?

È stato utile?

Soluzione 2

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.com/t/cant-update-wordpress-plugin/72068/6

Altri suggerimenti

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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a wordpress.stackexchange
scroll top