Install php and php-FPM 1. download the installation package & nbsp; php & nbsp; www.php.net & nbsp; php-fpm & nbsp; php-fpm.prgdownloads2. configure the installation environment & nbsp; gcc & nbsp; & nb php and php-FPM installation
1. download the installation package
Php www.php.net
Php-fpm http://php-fpm.prg/downloads/
2. configure the installation environment
Gcc-c ++
Libxml2 libxml2-devel
Autoconf
Libjpeg-devel
Libpng-devel
Freetype-devel
Zlib-devel
Glibc-devel
Glib2 glib2-devel
If other software packages are installed based on different linux versions
3. install php-fpm
Cd decompress package directory
./Configure -- prefix =/opt/php -- enable-fastcgi -- enable-fpm
Make
Make install
4. configure and optimize php-fpm
Php/opt/php/lib/php. ini
Php-fpm/opt/php/etc/php-fpm.conf
5. manage FastCGI processes (http server (eg. nginx apache) <= fastcgi => dynamic scripting language (eg. php ))
Start/opt/php/bin/php-cgi -- fpm or/opt/php/sbin/php-fpm start [stop | quit | restart | reload | logrotate]
View netstat-antl | grep 9000 or ps-ef | grep php-cgi
6. Configure nginx support for php
/Opt/nginx/conf/nginx. conf
Server {
......
Location ~ \. Php $ {
Fastcgi_pass unix:/tmp/php-cgi.sock;
Fastcgi_index index. php;
Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
Include fastcgi_params; // fastcgi_params is automatically generated during nginx installation.
}
......
}
7. test nginx's php parsing function
Create phpinfo. php in the root directory of localhost
View the CodeIgniter version:/system/CodeIgniter. php