Enabling PHP-FPM when PHP is compiled from source

I'm trying to begin using PHP-FPM as a replacement for FCGID/mod_fcgid on our Virtualmin Professional 6.07 system running on CentOS 7, but am having a problem getting Virtualmin to recognize that PHP-FPM support is available.

I've compiled PHP 7.2.22 from source with a prefix of /opt/rh/php72 and with the --enable-fpm option passed to the configure command. I've even put a php-fpm.conf file in /opt/rh/php72/root/etc and a www.conf file in the same directory. But when I use Virtualmin's "Re-check Configuration" tool, I always get the message that "No PHP-FPM packages were found on this system." Virtualmin does, however, successfully detect PHP 7.2.

I also created a service file in /usr/lib/systemd/system/php-fpm.service and started the /opt/rh/php72/sbin/php-fpm daemon (by way of the service file) before re-checking the configuration again, to no avail.

I don't have any PHP or PHP-FPM "packages" installed through YUm as I would rather compile PHP from source. How can I get Virtualmin to recognize PHP-FPM even if it wasn't installed from a package?

Status: 
Active

Comments

Howdy -- thanks for contacting us!

Sorry, reviewing the code for this, it does appear that it's looking for a PHP FPM rpm package.

So you could use a manually compiled version of PHP, but in that case you'd need to use FCGID or CGI.

Alternatively, if you want PHP-FPM, you'd need to use an RPM for that.

Hi,

Is there any way to "fool" Virtualmin into thinking a PHP-FPM package is installed when in reality PHP-FPM is coming from the compiled PHP installation and its PHP-FPM binary in /opt/rh/php72/sbin/php-fpm?

Unfortunately not - right now, FPM is detected only via which packages are installed.

Pardon my ignorance of RPM/YUM, but is it possible for me to build a sort of "dummy package" that meets the specifications Virtualmin is looking for (i.e. is named "php7-fpm" or whatever) but that would install or somehow point to the PHP-FPM binaries and other files used by my custom compiled version of PHP in /opt/rh/php72? I know you said Virtualmin is looking for a package, so is there a way I could build a package that will satisfy it rather than using one installed from an existing repository?