跳至內容

Permissions not updating - Strange Symbolic links issue on Lightsail / WordPress

0

When I launch a new instance on Amazon Lightsail for a WordPress website, I move the core WordPress files into a new folder under /opt/bitnami/wordpress/ named domainname.com, and do so for a couple virtual hosts.

For some reason, the initial WordPress install has symbolic links for the wp-config file, and the wp-content files when I view the directory. This issue seems to prevent me from fixing permissions issues also. I usually update permissions with the following:

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

But this doesn't do anything on this initial WordPress install. Whenever I create additional virtual host directories for other websites, updating permissions works as expected, and I don't see these symbolic links.

This issue is preventing me from updating plugins in the WP admin.

Anyone with some info or help would be greatly appreciated on how to fix this problem. Thank you!

已提問 3 年前檢視次數 801 次
1 個回答
2
已接受的答案

To resolve the issue with the symbolic links in the initial WordPress install, you can try breaking the symbolic links and replacing them with the actual files. This can be done by executing the following commands:

sudo rm /opt/bitnami/wordpress/domain.com/wp-config.php sudo cp /opt/bitnami/wordpress/wp-config.php /opt/bitnami/wordpress/domain.com/wp-config.php

sudo rm -rf /opt/bitnami/wordpress/domain.com/wp-content sudo cp -r /opt/bitnami/wordpress/wp-content /opt/bitnami/wordpress/domain.com/wp-content

Then, you can update the permissions with the commands you provided:

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

This should resolve the issue with the symbolic links and allow you to update plugins in the WP admin.

已回答 3 年前
  • That worked, thanks!

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。