Very strange permissions problem
-
Hi!
The situation: I operate about 20 wordpress installations on a managed server. These installations have been cloned from 1 basic installation. The server environment is the same for all of them, all use ssl, all use php 8. Installed plugins are more or less the same.
Some months ago, 2 of those sites stopped auto-updating. I checked and tried to update manually and got the well-known error “Installation Failed: Could Not Create Directory”. Well, I checked permissions but all permissions are ok (755/644). So I tried to install a new plugin – which also failed, but I noticed that WP was no longer installing as the www-user, but as apache! Of course this won’t work, but – how do I fix this? What could cause this?
After all, this is a major change in the behaviour of the program, and I have not the slightest idea what is going on here and why.
Again:
– wp-config.php is basically the same
– .htaccess is basically the same
– server environment is the same
– out of about 20 almost identical installations, two suddenly work under “apache” instead of the www-userAny ideas, anyone?
Cheers,
Alex-
This topic was modified 3 years, 3 months ago by
faglork.
The page I need help with: [log in to see the link]
-
This topic was modified 3 years, 3 months ago by
-
The user with whom you write WordPress files depends on the web server service you use. This is not something that WordPress as software can determine or set on a system.
You should therefore check the vhost settings again. There must be a difference between this and the other websites. You could also check the phpinfo() output. With the plugin https://wordpress.org/plugins/health-check/ you can also check this in the WordPress backend under Tools > Health Status > Info > Button “PHP-Information” (at the very bottom). There, under “Environment”, you can see the user with whom the web server is working.
Thanks!
I managed to install the Health Check plugin MANUALLY by uploading the .ZIP, which worked but installed it with the owner “apache” (installing directly from the wordpress plugin list fails because missing permissions …). Anyway, the plugin works.
Now:
I checked Tools > Health Status > Info > Button “PHP-Information” on one site (A) that works (updating/installing as “www123”) and one (B) that works not (updating/installing as “apache” and failing).
Turns out: In both cases the user is “apache”.
Yet when I install a plugin on site (A) the owner of the files is “www123” (as it should be), and everything is fine.
On site (B) it tries to install the plugin under the owner “apache” and fails.
“The user with whom you write WordPress files depends on the web server service you use. This is not something that WordPress as software can determine or set on a system. […] There, under “Environment”, you can see the user with whom the web server is working.”
As I said, in both cases – according to phpinfo – the user is “apache”.
So it must be something else.
I then checked the complete phpinfo() for both sites. I saved the output and ran it through UltraCompare. Result: identical, only diff is the server directory …
When the user under which WP is operation is “apache”, then in case of website (A) (and all other websites) there MUST be a piece of code somewhere to determine that all files/directories should be written with “www123” as user. I checked the FTP-Information in wp-config.php: they are correct in both cases, giving the credentials for their respecctive ftp user.
So I am still at a loss. Why does website (B) use “apache”?
Cheers,
AlexThis might help…
https://www.simplified.guide/apache/change-user-and-group
“Default user and group for Apache process usually are not the same in a different distribution. Ubuntu, for example, sets the default user and group to www-data, while on CentOS, it’s apache”
/etc/apache2/apache2.conf contains User and Group directives which may point elswhere eg: /etc/apache2/envvars file
Again, what you are looking for cannot be solved by wordpress. Check the information in your Apache vhost as described in the link above. You can find the Apache manual here: https://httpd.apache.org/docs/2.4/mod/mod_unixd.html – as written, the specifications are given by the Linux distribution you are using, but if you are using a server management system such as cpanel or Plesk, the rules may be completely different. Since no one here knows your system, we cannot help you any further in this forum.
If you have further questions, I would recommend that you contact a community that deals with your server system.
Thanks for your input!
“Default user and group for Apache process usually are not the same in a different distribution. Ubuntu, for example, sets the default user and group to www-data, while on CentOS, it’s apache”
As I said: all sites reside on the same server, use the same environment, same php vesion, and are all clones of 1 wordpress installation.
——————————-
“Check the information in your Apache vhost as described in the link above. ”
As I already said: I did, and they are identical:
“I then checked the complete phpinfo() for both sites. I saved the output and ran it through UltraCompare. Result: identical, only diff is the server directory …”
httpdconfig is identical as well (besides domain an directory etc.)
Cheers,
Alex
The topic ‘Very strange permissions problem’ is closed to new replies.