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目录里面

 

 

相关推荐