admin管理员组

文章数量:1389768

I have a strange problem with my wordpress websites. Every time I perform plugin updates, the file permissions on my server, are changed. I get the Forbidden error in my developer console for the plugins directory that I've just update .

I use a local server with Webmin/Virtualmin to managed all my wordpress websites. So, I have virtual host for every website, and I have the same problem with all of the websites.

After updating the plugins, I have to change the file permissions, with default permissions for the wordpress, and everything works.

This are my default permissions for every wordpress website

sudo find . -type d -exec chmod 775 {} \
sudo find . -type f -exec chmod 664 {} \

I have a strange problem with my wordpress websites. Every time I perform plugin updates, the file permissions on my server, are changed. I get the Forbidden error in my developer console for the plugins directory that I've just update .

I use a local server with Webmin/Virtualmin to managed all my wordpress websites. So, I have virtual host for every website, and I have the same problem with all of the websites.

After updating the plugins, I have to change the file permissions, with default permissions for the wordpress, and everything works.

This are my default permissions for every wordpress website

sudo find . -type d -exec chmod 775 {} \
sudo find . -type f -exec chmod 664 {} \
Share Improve this question edited Feb 18, 2020 at 13:53 Iacob Berar asked Feb 18, 2020 at 9:52 Iacob BerarIacob Berar 12 bronze badges 7
  • What does webmin/virtualmin support say? – Tom J Nowell Commented Feb 18, 2020 at 10:20
  • I didn't find anything on google about this strange behavior. – Iacob Berar Commented Feb 18, 2020 at 10:26
  • So what do they need to be, and what is WordPress setting them to? When you say forbidden error in developer console, I assume you're talking about CSS/JS assets? It's unclear – Tom J Nowell Commented Feb 18, 2020 at 10:34
  • Yes, it's about css/js asset. This is an example from one site /wp-content/plugins/eu-cookie-law/js/scripts.js?ver=3.1 net::ERR_ABORTED 403 (Forbidden) – Iacob Berar Commented Feb 18, 2020 at 10:35
  • After plugin update, the permission is 705 for directory, and 604 for files. It remove group permissions for dirs and files – Iacob Berar Commented Feb 18, 2020 at 10:38
 |  Show 2 more comments

1 Answer 1

Reset to default 0

PROBLEM FOUND:

So the problem was in a separate config file. The websites were migrated from another hosting and that hosting had a separate config file which was required in the wp-config.php . I the other config file I found this settings:

define( 'FS_CHMOD_DIR', ( 0755 & ~ umask() ) );
define( 'FS_CHMOD_FILE', ( 0644 & ~ umask() ) );

I remove this 2 lines from config file, and everythig works fine !

本文标签: Plugin updateschange file permissions on WordPress