Ticket #2426 (new enhancement)
Add php-fpm support
|Reported by:||pulponair||Owned by:|
|Priority:||normal||Milestone:||ispCP ω 1.2.0|
|Component:||Backend (Engine)||Version:||ispCP ω 1.0.6|
|Severity:||Medium||Keywords:||php fpm fastcgi|
As of version php 5.3.3 php ships with php-fpm.
One mayor benefit of using the fpm SAPI over regular fastcgi/fcgi starters is the fact, that i use a single root php process which enables us to share shm (shared memory - e.g. used by opcode caches) accross all runing php process. This would dramatically increase opcode cache efficiency while it decreases overall memory consumption.
Another benefit is the fact that the php-fpm deamon is cabable of its own dynamic adaptive process spawning. So the php process handling can be handed over completly to php-fpm, instead of using a creppy mixture of fastcgi-pm and php's own child managment.
See http://php-fpm.org/ for the big picture. I worked out a ispcp apache configuration (see below) and tested it in various scenarios (posted to php-highload as well).
Besides the apache configuration there has to be a php-fpm configuration which is pretty straight forward.
Note: You need mod_fastcgi, since mod_fcgi is'nt cabable of anything similar to FastCGIExternalServer
For a full ispcp integration the ispcp engine needs to be modified to manage the fpm configuration file.
Apache configuration is just a template matter.
If anyone could guide me (haven't worked with perl for decades Wink ). I could come up with a patch.
Within mod_fastcgi.conf (global):
# We want to have all sockets within this directory FastCgiIpcDir /var/lib/apache2/fastcgi2 # Register a cumstom handler to .php .php5 scripts AddHandler php-fastcgi .php .php5 # Point this handler to /php5/php-fpm Action php-fastcgi /php5/php-fpm # Set the register fastcgi-script handler + # whatever you want for a fpm request. <Location /php5/php-fpm> SetHandler fastcgi-script Options +ExecCGI </Location> #Set mime type AddType application/x-httpd-php .php .php5
# Alias /php5/ to /var/www/fcgi/www.example.com/ ScriptAlias /php5/ /var/www/fcgi/www.example.com/ # Pickup request and forward it to the particular fpm socket. FastCGIExternalServer /var/www/fcgi/www.example.com/php-fpm -socket www.example.com