php 的配置
(一) 、编译 PHP 的安装包---此处为 5.4.36 版本的 php
[root@server1 ~]# yum install libxml2-devel net-snmp-devel curl-devel libpng-devel libjpeg-devel freetype-devel gmp-devel openldap-devel
[root@server1 php-5.4.36]# ./configure \
--prefix=/usr/local/lnmp/php \
--with-config-file-path=/usr/local/lnmp/php/etc \
--with-mysql=/usr/local/lnmp/mysql/ \
--with-mysqli=/usr/local/lnmp/mysql/bin/mysql_config \
--with-openssl --with-snmp --with-gd --with-zlib \
--with-curl --with-libxml-dir --with-png-dir \
--with-jpeg-dir --with-freetype-dir --without-pear \
--with-gettext --with-gmp --enable-inline-optimization \
--enable-soap --enable-ftp --enable-sockets --enable-mbstring \
--enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-mhash
[root@server1 php-5.4.36]# make && make install
(二) 、启动 PHP
[root@server1 ~]# cp /root/php-5.4.36/php.ini-production /usr/local/lnmp/php/etc/php.ini
[root@server1 ~]# cp /root/php-5.4.36/sapi/fpm/init.d.php-fpm /etc/init.d/fpm
[root@server1 ~]# chmod +x /etc/init.d/fpm
[root@server1 etc]# cd /usr/local/lnmp/php/etc/
[root@server1~]# cp php-fpm.conf.default php-fpm.conf
[root@server1 ~]# vim /usr/local/lnmp/php/etc/php-fpm.conf
25 pid = run/php-fpm.pid
[root@server1 ~]# vim /usr/local/lnmp/php/etc/php.ini
909 date.timezone = Asia/Shanghai
[root@server1 ~]# /etc/init.d/fpm start
[root@server1 ~]# vim /usr/local/lnmp/nginx/html/index.php
[root@server1 ~]# vim /usr/local/lnmp/nginx/conf/nginx.conf
49 location / {
50 root html;
51 index index.php index.html index.htm;
52 }
71 location ~ \.php$ {
72 root html;
73 fastcgi_pass 127.0.0.1:9000;
74 fastcgi_index index.php;
75 # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_scrip
t_name;
76 include fastcgi.conf;
77 }
@@@@@@
[root@server1 ~]# ll /usr/local/lnmp/nginx/conf/fastcgi.conf
-rw-r--r-- 1 root root 1034 Jan 13 16:06 /usr/local/lnmp/nginx/conf/fastcgi.conf
[root@server1 ~]# nginx -s reload
转载于:https://www.cnblogs.com/tyzZ001/p/5754768.html