下载好php 解压
安装php5.6.2
cd到目录下执行
./configure --prefix=/usr/local/php6 --with-config-file-path=/usr/local/php6/etc --with-config-file-scan-dir=/usr/local/php6/conf.d --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --disable-fileinfo --enable-opcache --enable-intl --with-xsl
make && make install
报错后make: *** [sapi/cli/php] Error 1
make ZEND_EXTRA_LIBS='-liconv'
再次继续
make install
配置php-fpm设置
cp /usr/local/php6/etc/php-fpm.conf.default /usr/local/php6/etc/php-fpm.conf
以下是php-fpm的php-fpm.conf设置
[global]
pid = /usr/local/php6/var/run/php-fpm.pid
error_log = /usr/local/php6/var/log/php-fpm.log
log_level = notice
[www]
listen = /tmp/php6-cgi.sock
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
listen.mode = 0666
user = www
group = www
pm = dynamic
pm.max_children = 40
pm.start_servers = 20
pm.min_spare_servers = 20
pm.max_spare_servers = 40
request_terminate_timeout = 100
request_slowlog_timeout = 0
slowlog = var/log/slow6.log
cd到/etc/rc.d/init.d
先复制一个原来的php-fpm再改改
创建php-fpm6服务
chkconfig --add php-fpm6
chkconfig --level 2345 php-fpm6 on
启动php-fpm6服务
service php-fpm6 start
修改nginx的enable-php.conf配置
fastcgi_pass unix:/tmp/php6-cgi.sock;
改完相对应的/tmp/php6-cgi.sock保存
重启
nginx -s reload
原来那个版本缺少插件特意去替换的
杀死原来php-fpm的进程
kill -9 12574
make clean
./configure --prefix=/usr/local/php8 --with-config-file-path=/usr/local/php8/etc --with-config-file-scan-dir=/usr/local/php8/conf.d --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-freetype-dir --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --disable-fileinfo --enable-opcache --enable-intl --with-xsl
make && make install
cp /usr/local/php8/etc/php-fpm.conf.default /usr/local/php8/etc/php-fpm.conf
chkconfig --add php-fpm8
chkconfig --level 2345 php-fpm8 on
service php-fpm8 start
ps -ef|grep php|grep -v grep|awk '{print $2}'|xargs kill -9