Linux环境部署 Tengine2.1.12(Nginx)+PHP5.6.30

记录一下Linux环境部署 Tengine2.1.12(Nginx)+PHP5.6.30过程,以便帮助其他人,至于为什么用php5.6 而不是7,感觉老版本稳定。

1.下载php5.6.30

2.编译安装

tar zxf php-x.x.x cd ../php-x.x.x ./configure --enable-fpm --with-mysql make make install

3.准备运行环境

cd php-x.x.x.源码路径 cp php.ini-development /usr/local/php/php.ini cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf cp sapi/fpm/php-fpm /usr/local/bin

4.修改运行配置

vim /usr/local/php/php.ini #Locate cgi.fix_pathinfo= and modify it as follows: cgi.fix_pathinfo=0 vim /usr/local/etc/php-fpm.conf ; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. user = www-data group = www-data

5.启动

/usr/local/bin/php-fpm

6.tengine配置修改

location / { root html; index index.php index.html index.htm; } location ~* \.php$ { fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; }

7.tengine启动

sudo /usr/local/nginx/sbin/nginx -s stop sudo /usr/local/nginx/sbin/nginx

8.写一个测试文件,丢在tengine的html目录里面

rm /usr/local/nginx/html/index.html echo "<?php phpinfo(); ?>" >> /usr/local/nginx/html/index.php 官网文档,,这是不主介绍tengine的安装,很简 单的,参考tengine的官网文档即可

本文永久更新链接地址:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/cd413f8b31d6ea9efcd620d66da86229.html