Questions on alternate PHP/PHP-FPM (file perms, modules, site level php.ini)

So I’m starting to venture into using the newer PHP alternate version with newer sites and have run into some questions / issues.

  1. File Permissions
    I currently have left my base PHP using the suphp, so I believe that this different is just with using PHP-FPM. But apache no longer seems to care who owns the file. Is this the norm? What user does apache run as when going through PHP-FPM?

  2. Missing Modules
    I’m not sure if this is how this is supposed to be or not, but it seems like when I am trying out a PHP 7.2 for example I have to install basic modules, like PDO (yum install php72-php-pdo). Why aren’t all the basic modules installed like they are on the base?

  3. Local PHP.INI
    Guessing this is just another PHP-FPM change. I looked up on using a .user.ini file inside the HTML directory and that seems to work, but when I make changes to the file they don’t seem to take effect until I restart PHP-FPM service. Which is very different than how the old /home/site/etc/php.ini worked.

UPDATE

– File Permissions –
It looks like it just runs as whomever the owner of the file is. So if you made a file a root owner, that PHP script would run as root. Got to be careful there!

– Missing Modules –
I didn’t have PHP 7.3 enabled and just did it now and it installed all the needed modules by default, so maybe it was a bug with 71 and 72, or just the previous behavior of how IW handled this when I set this up months ago. What would happen to the sites that are currenting running on PHP71/72 if I remove PHP 71/72 and then reinstalled? Would they just go down for a bit or would they switch back to the default system PHP and I would have to edit each account to change it back?

EDIT: Unchecking a PHP version doesn’t remove it, just makes it “disabled.” This makes sense so it doesn’t take down websites that are already running on it. So there is no way to uninstall it via NodeWorx. My host was nice enough to just install all the missing base modules that came installed with 7.3 into 7.2 and 7.1.

– Local PHP.INI –
Ok, after talking with my host it looks like the .user.ini is the way to go and PHP-FPM resets itself automatically every 5 mins, I guess I was just impatient. The only other note is that being in the public html, that .user.ini could be viewed, so looks like you also should deny access to that file in the .htaccess file. Would be a nice feature to add this directly through SiteWorx and have IW system handle creating all the files and protecting them.