Why does WordPress work without www-data?

It’s not an issue but I can’t understand how it works.

For wordpress to work it needs or FTP access or direct control over the WP folder.

I’ve wordpress installed with 775 permissions and userx:userx as user and group so, it’s not using www-data and users have no write perms…

How it’s working???

userx is not on the www-data group or something, they have nothing in common…

Maybe this is not a Virtualmin question but an Apache/WordPress question but I installed it using the Virtualmin install script and I’ve all with Virtualmin and it may be a config made bc of this…

How is what working?

What PHP execution mode have you set on the PHP Options page? Also, what operating system and version are you using?

I’m using FPM with PHP 8.1.2.

Ubuntu Server 22.04.4 and Virtualmin 7.10.0(the latest version)

Using wordpress 6.5.3 installed with the install script and using a MariaDB DB.

Everything created with an owner user, not with a sudo user, all the folders and files with userx:usex not www-data:www-data and perms 775 so others can’t write.

The way it is, when you install a plugin on WordPress or something it should ask you for an FTP conection to be able to change files but it’s not, wordpress is able to write files without permissions and without FTP.

I have wordpress configured to force direct write so is impossible for it to use FTP

This is exactly the right way to do it! You should never follow the practice of writing files to a user’s home directory using the web-server user, like www-data! All files under a user’s home should be owned by the virtual server owner user.

This is a flawed paradigm created during the mod_php era.

None of this is correct; just connect to your server using the virtual server owner user, and it will work just fine.

WordPress will write files with the correct user already, since you’re using PHP-FPM.

Ohhhh it’s an FPM thing…

Wordpress works ± the way I sait without FPM, at least on another server I saw(on my job) they are not using FPM and it work the way I said.

Thx a lot for the info, I didn’t knew FPM was able to do that ^^

EDIT: I love Virtualmin lol, it’s amazing

That is wrong; that is a bug!

If you use Ubuntu/Debian go to Website Options and switch CGI execution mode to suEXEC!

Oh nono, we are not using Virtualmin on that other server.

We are using windows server with apache and php, we have any manager or something.

So idk how they have it configured but it works that way lol

So after some tests I thought that was the way wordpress worked, but it maybe something they have

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.