Use PHP mode different than CGI FCGID mod_php


We want to use mod_lsapi for a php process manager which do not use CGI to execute php. All it need is to set handler for example:

AddType application/x-httpd-lsphp .php

in the apache virtual host and remove all other directives added for fcgid. Which can be set globally and it will work. But here comes the issue - Detect and select different PHP versions did not work.

It doesn't work because of two things: 1. this method use lightSpeed PHP which executable is lsphp and not php or phpXX so VM is unable to detect php

  1. It doesn't USE any kind of wrapper but simple handlers (Actually you set custom handler for every lsphp version in lsapi configuration)

So Selecting PHP versions is simpler than fcgid.

But is there a way in VM to set a custom way to change PHP versions per website.

Benefits on this are: 1. users can use APC cache which is shared between users processes 2. Process can survive between graceful restarts. No more 500 errors when apache restarts. 3. Faster process spawning 4. mod_php emulation "php_value, php_admin_value, php_flag, php_admin_flag" 5. PHP is executed with the users permissions so security does not hit.

Here is little more info

Can I change the way php selector is working and also the process of detecting PHP versions.

  • I know this works with paid kernel and it is beta but already tested it and it work very good.

If there is a way to have all cloudlinux controls in implemented in webmin/virtualmin it will be awesome. They did a very impressive work for a shared hosting environment rising the security and the reliability of the servers.



Right now, it would be hard to add a new PHP execution mode to Virtualmin as it has impact across many functions such as script installers, per-domain php.ini setting, and more. However, after a domain has been created you can manually edit the Apache <virtualhost> block for the domain to enable use of mod_lsphp if you prefer..