First, configure php-fastcgi
1, installation wget http://www.fastcgi.com/dist/mod_fastcgi-2.4.6.tar.gz
Tar xzf mod_fastcgi-2.4.6.tar.gz
CD mod_fastcgi-2.4.6
CP MAKEFILE.AP2 Makefile
Make Top_dir=/usr/local/apache
Make Top_dir=/usr/local/apache Install
2, edit httpd.conf configuration file, add the fastcgi module load code:
LoadModule Fastcgi_module modules/mod_fastcgi.so
3, configure Apache support PHP
Edit the httpd.conf file and add the following code:
### fastcgi ###
scriptalias/fcgi-bin/"/usr/local/php/bin/"
AddHandler php-fastcgi. php
Action php-fastcgi/fcgi-bin/php-cgi
AddType application/x-httpd-php. php
<ifmodule mod_fcgid.c>
AddHandler Fcgid-script. . php. fcgi ### temporarily configures support only. php
IdleTimeout 300
Processlifetime 1800
Maxprocesscount 100
Defaultminclassprocesscount 3
Defaultmaxclassprocesscount 8
Ipcconnecttimeout 15
Ipccommtimeout 300
Maxrequestsperprocess 100
</IfModule>
### fastcgi ###
4, edit httpd.conf file, set up a virtual host can be configured like this:
<virtualhost *:80>
Documentroot/usr/local/apache/htdocs
ServerName localhost
Options +execcgi
AddHandler Fastcgi-script. fcgi
AddType application/x-httpd-php. php
Action application/x-httpd-php/fcgi-bin/php-cgi
<Directory/usr/local/apache/htdocs>
Options Indexes execcgi
Order Allow,deny
Allow from all
</Directory>
</VirtualHost>
Second, the pressure test
A total of 500 persons requested 5,000 orders as follows:
/usr/local/apache/bin/ab-c 500-n 5000 http://localhost/index.php
The following is a test result configured with php-fastcgi:
The following test results are not configured for php-fastcgi:
Third, summary
The performance of php-fastcgi is quite remarkable.