Php-fpm (New fast CGI server)

Draft version only

For mLinux versions 4.0 and higher:

In mLinux 4, the php-fpm server module is the new Fast CGI server. It has better performance than the old fast-cgi serever.

/etc/lighttpd.conf now has a section for php-fpm, which is the new fast-cgi server.

Add the mod_fastcgi server module to lighttpd by uncommenting mod_fastcgi:

server.modules              = (
...
#                               "mod_setenv",                                  
#                               "mod_fastcgi",                                 
#                               "mod_proxy",

Uncomment the following section (this is new):

#fastcgi.server             = ( ".php" =>                                      
#                               ( "localhost" =>                               
#                                 (                                            
#                                   "socket" => "/var/run/php-fpm.socket",     
#                                   "broken-scriptfilename" => "enable"        
#                                 )                                            
#                               )                                              
#                            )

Activate the php-fpm server by changing no to yes in /etc/default/php-fpm:

# set to "yes" or "no" to control starting on boot
ENABLED="yes"

Create a test example /www/pages/hello.php:

<html><body>
<h1>It Works!</h1>
<h2>
<?php
echo "It works php";
?>
</h2>
</body></html>

Restart the servers:

mtcdt:~$ sudo /etc/init.d/lighttpd restart
Password: 
Restarting Lighttpd Web Server: stopped /usr/sbin/lighttpd (pid 1835)
lighttpd.
mtcdt:~$ sudo /etc/init.d/php-fpm restart 
Gracefully shutting down php-fpm . done
Starting php-fpm  done

In a browser, enter the IP and name of the PHP file:

http://192.168.2.1/hello.php:

You should see:

It Works!
It works php