First, what is PHP
PHP that is, "Hypertext Preprocessor" is a general open-source scripting language. PHP is a server-side scripting language to perform in, similar to the C language, a common website programming languages. PHP syntax unique mix of C, Java, Perl and PHP own syntax. Conducive to learning, widely used, mainly for Web development.
With the general principle similar LAMP architecture, there are a few differences in the structure LNMP will start a service in php: php-fpm, and LAMP in php only exist as an Apache module. Nginx will request the user to php dynamic service to deal with, this service will be to php and database interaction. Static user requests Nginx will deal directly, Nginx handle static requests faster than the speed of apache much better performance, so Nginx and apache on a dynamic request handling very different, but if it is still processing the request, they would obviously want to find Nginx faster than apache, Nginx and can withstand the amount of concurrent apache than large, can withstand the amount of concurrent tens of thousands, so a large number of sites will use Nginx as a web server.
Second, the experimental
1. Installation deployment environment package
2. The decompression php mounted under / opt directory
3. Installation Configuration function module
4.Make the install the make &&
5. The modified core profile
6. Turn php-fpm module
for an open profile the monitoring engine PID
7. the modified extension profiles
8. open service inspection port
9. All command php facilitate identification system
10. the function allows nginx support PHP
location ~ \.php$ {
root html;//指定站点目录
fastcgi_pass 127.0.0.1:9000;//指定fpm模块所在位置,IP地址,9000端口
fastcgi_index index.php;//指定默认首页类型
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;//指定脚本文件所在目录
include fastcgi_params;//将nginx中的变量转换成PHP能识别的变量
}
Here all LNMP infrastructure services have all been set up is completed.
Restart the service and test!
PHP pages to build complete!