一、先安装好centos的Linux(我的版本是centos 6.5)
二、安装apace(参照:https://zhangguanzhang.github.io/2017/02/02/lamp/)
如果 ./configure --prefix=/usr/local/pcre 后报这个错误:“configure: error: no acceptable C compiler found in $PATH”
执行以下命令:
yum install -y gcc gcc-c++
二、安装MySQL(参照:https://zhangguanzhang.github.io/2017/02/02/lamp/)
二、安装PHP(参照:https://zhangguanzhang.github.io/2017/02/02/lamp/)
如果在cd php* 后 ./configure 出现这个错误“configure: error: mcrypt.h not found. Please reinstall libmcrypt.”
执行以下命令:
cd /usr/local/src
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz
tar -zxvf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure --prefix=/usr/local
make && make install
安装完后需要配置php-fpm
cd /usr/local/php/etc
cp php-fpm.conf.default php-fpm.conf
五、安装Redis(参照:https://zhangguanzhang.github.io/2017/02/02/lamp/)
六、安装Nginx(安装前关闭Apache:service httpd stop)
wget http://nginx.org/download/nginx-1.10.3.tar.gz
tar -zxvf nginx-1.10.3.tar.gz
cd nginx-1.10.3/
./configure --prefix=/usr/local/nginx --with-pcre=../pcre-8.39
make && make install
# 启动Nginx
/usr/local/nginx/sbin/nginx
#查看Nginx进程
ps -ef | grep nginx
#测试Nginx是否成功启动
curl 127.0.0.1
#如果出现 “..Thank you for using nginx.” 则Nginx安装成功并可以使用
#关闭Nginx(ps -ef | grep nginx后显示的master proess 那行root后面的数字就是进程号)
kill -quit Nginx的进程号
六、配置php-fpm
# cd /usr/local/php/etc
# cp php-fpm.conf.default php-fpm.conf
具体的测试php-fpm 参考:http://www.jb51.net/article/42716.htm