Apache + multiple php-fpm version per directory

SYSTEM INFORMATION
OS type and version: ubuntu 20.04
Webmin version: Version 1.984
Virtualmin version: Version 6.17

i have a server for developing multiples sites and domains.
I miss the option for selection different php version when running apache with FPM. with fastcgid it works.
i need this feature, because sometimes i have old sites which lives in a subdirectory but running in different php version.
currently i change apache config files and addedd fpm pool manually which will be overriden when i don changes to the virtual server.

is there any plan to add the option for multiple php version per directory in FPM mode?

This feature was on offer in every version of Virtualmin till it was retired recently. There are not too many Virtualmin users who needed this feature, so it was removed. I don’t know if the Virtualmin API supports configuring different directories to use different versions of PHP. Perhaps someone who uses this feature can say for sure.

I understands that is this feature not used by alot of users. because most users use then subdomain and redirect to that subdomain and configure subdomain to use different php version.
I think it a good usability when both FCGId and FPM share same functionality.

currently i done it manaul by

1- create a pool for my virtual-server user in php-fpm 5.6.
2- add a directory options in apache configuration for the virtual host and added

<FilesMatch \.php$>
 SetHandler proxy:fcgi://localhost:8100
</FilesMatch>

Thanks for sharing your solution. It will help others who wish to use this functionality.

@Jamie, would this be hard to implement?

Yeah, I considered this but it’s hard to implement due to the way proxying of requests to FPM is configured.

Using proxy php-fpm to tcp port is difficuilt for generating FPM Pools as you need to know which port is used, but if we use unix socket, it is easear to use domain ID as prefix and we can generate pool files for configured versions is straightforward.
I can’t program in perl , i am php programmer, so i can’t help here.

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