--with-mcrypt \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--enable-short-tags \
--enable-static \
--with-xsl \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--enable-ftp \
--enable-fpm
make
make install
4、配置php,php-fpm
cp php.ini-production /usr/local/php/lib/php.ini
cd /usr/local/php/etc
cp php-fpm.conf.default php-fpm.conf
5、启动php服务(FastCGI方式)

/usr/local/php/sbin/php-fpm
检查php-fpm进程,以及侦听端口
ps -ef | grep php-fpm
netstat -tnlp | grep php-fpm
6、配置Nginx,设置测试页index.php,test_mysql.php
[root@centos7-1 conf.d]# cat benet3.com.conf
server {
listen 80;
server_name benet3.com;
location / {
root /data/www/www.benet3.com;
index index.html index.php index.htm;
}
location ~* .*\.(php|php5)$ {
root /data/www/www.benet3.com;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
includefastcgi.conf;
}
}
[root@centos7-1 ]# ll
total 12
-rw-r--r-- 1 root root 24 Feb 11 16:33 index.html
-rw-r--r-- 1 root root 21 Feb 11 16:36 index.php
-rw-r--r-- 1 root root 138 Feb 11 16:54 test_mysql.php
[root@centos7-1 ]# cat index.php
<?php
phpinfo();
?>
[root@centos7-1 ]# cat test_mysql.php
<?php
$conn = @ mysql_connect("192.168.52.132", "root", "123456a-j") or die("连接错误");
echo "连接成功";
?>
win10客户端测试访问
php
mysql.php
centos7.4 编译安装php5.6 (LNMP)
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-72532-2.html
但采取哪种
如果小米公司不申冤