wdcp php fpm,wdcp使用nginx ,多php版本并存。

安装不同版本php

wdcp默认只能支持一个php版本,但是使用nginx就可以进行多php版本并存。下面是默认5.2并存5.3

wdcp2.0预装环境,并行php执行脚本

php5.3的脚本代码

#!/bin/bash

###yum

yum install -y libmcrypt-devel libjpeg-devel libpng-devel freetype-devel curl-devel openssl-devel libxml2-devel gmp-devel

###

if [ ! -f php-5.3.29.tar.gz ];then

wget -c http://dl.wdlinux.cn:5180/soft/php-5.3.29.tar.gz

fi

if [ ! -f iconv_ins.sh ];then

wget -c http://down.wdlinux.cn/in/iconv_ins.sh

sh iconv_ins.sh

fi

###

tar zxvf php-5.3.29.tar.gz

cd php-5.3.29

if [ -d /www/wdlinux/nginx_php ];then

make clean

./configure --prefix=/www/wdlinux/nginx_php-5.3.29 --with-config-file-path=/www/wdlinux/nginx_php-5.3.29/etc --with-mysql=/www/wdlinux/mysql -with-mysqli=/www/wdlinux/mysql/bin/mysql_config --with-iconv=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --with-gmp --enable-ftp --enable-sockets --enable-zip --enable-fpm

[ $? != 0 ] && echo "configure err" && exit

make

[ $? != 0 ] && echo "make err" && exit

make install

[ $? != 0 ] && echo "make install err" && exit

cp php.ini-production /www/wdlinux/nginx_php-5.3.29/etc/php.ini

#grep '\[eaccelerator\]' -A15 /www/wdlinux/nginx_php/etc/php.ini >> /www/wdlinux/nginx_php-5.3.29/etc/php.ini

#grep '\[Zend\]' -A5 /www/wdlinux/nginx_php/etc/php.ini >> /www/wdlinux/nginx_php-5.3.29/etc/php.ini

sed -i 's/short_open_tag = Off/short_open_tag = On/g' /www/wdlinux/nginx_php-5.3.29/etc/php.ini

service php-fpm stop

rm -f /www/wdlinux/nginx_php

ln -sf /www/wdlinux/nginx_php-5.3.29 /www/wdlinux/nginx_php

cp /www/wdlinux/nginx_php-5.3.29/etc/php-fpm.conf.default /www/wdlinux/nginx_php-5.3.29/etc/php-fpm.conf

sed -i 's/user = nobody/user = www/g' /www/wdlinux/nginx_php-5.3.29/etc/php-fpm.conf

sed -i 's/group = nobody/group = www/g' /www/wdlinux/nginx_php-5.3.29/etc/php-fpm.conf

sed -i 's/;pid =/pid =/g' /www/wdlinux/nginx_php-5.3.29/etc/php-fpm.conf

sed -i 's/127.0.0.1::9000/127.0.0.1::9003/g' /www/wdlinux/nginx_php-5.3.29/etc/php-fpm.conf

cp -f sapi/fpm/init.d.php-fpm /www/wdlinux/init.d/php53

chmod 755 /www/wdlinux/init.d/php-fpm

service php53 start

echo

echo "php update is OK"

fi

echo

php5.3 php-fpm端口9003 下载链接:5.3脚本 下载地址:http://www.gotoip.top/download/php_up53.sh

命令 5.3:sh php_up53.sh

php5.4 5.5 5.6的脚本代码

#!/bin/bash

# PHP 5.4 update scripts

# Author: wdlinux

# Url: http://www.wdlinux.cn

# Modify: fengye

if [ ! $1 ];then

Ver=5.4.26

X=4

else

if [ $1 = 5.5.32 ];then

Ver=$1

X=5

else

Ver=$1

X=6

fi

fi

###yum

yum clean all

yum install -y gcc gcc-c++ make autoconf libtool-ltdl-devel gd-devel freetype-devel libxml2-devel libjpeg-devel libpng-devel openssl-devel curl-devel patch libmcrypt-devel libmhash-devel ncurses-devel bzip2-devel libcap-devel gmp-devel t1lib-devel libc-client-devel sqlite-devel aspell-devel readline-devel recode-devel libtidy-devel libxslt-devel openldap-devel

ln -s /usr/lib64/libc-client.so /usr/lib/libc-client.so

###

if [ ! -f php-${Ver}.tar.gz ];then

wget -c http://cn2.php.net/distributions/php-${Ver}.tar.gz

fi

if [ ! -f iconv_ins.sh ];then

wget -c http://down.wdlinux.cn/in/iconv_ins.sh

sh iconv_ins.sh

fi

###

if [ -f /www/wdlinux/mysql/lib/libmysqlclient.so.18 ];then

if [ -d /usr/lib64 ];then

LIBNCU="/usr/lib64"

else

LIBNCU="/usr/lib"

fi

ln -sf /www/wdlinux/mysql/lib/libmysqlclient.so.18 $LIBNCU

fi

tar zxvf php-${Ver}.tar.gz

cd php-${Ver}

if [ -d /www/wdlinux/nginx_php ];then

make clean

./configure --prefix=/www/wdlinux/nginx_php-${Ver} --with-config-file-path=/www/wdlinux/nginx_php-${Ver}/etc --with-mysql=/www/wdlinux/mysql --with-iconv=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-soap --with-imap --with-kerberos --with-imap-ssl --enable-ftp --enable-sockets --enable-zip --enable-fpm --with-mysqli=/www/wdlinux/mysql/bin/mysql_config --with-pdo-mysql=/www/wdlinux/mysql --with-gmp --enable-bcmath

[ $? != 0 ] && echo "configure err" && exit

make

[ $? != 0 ] && echo "make err" && exit

make install

[ $? != 0 ] && echo "make install err" && exit

cp php.ini-production /www/wdlinux/nginx_php-${Ver}/etc/php.ini

sed -i 's/short_open_tag = Off/short_open_tag = On/g' /www/wdlinux/nginx_php-${Ver}/etc/php.ini

service php-fpm stop

#rm -f /www/wdlinux/nginx_php

#ln -sf /www/wdlinux/nginx_php-${Ver} /www/wdlinux/nginx_php

cp /www/wdlinux/nginx_php-${Ver}/etc/php-fpm.conf.default /www/wdlinux/nginx_php-${Ver}/etc/php-fpm.conf

sed -i 's/user = nobody/user = www/g' /www/wdlinux/nginx_php-${Ver}/etc/php-fpm.conf

sed -i 's/group = nobody/group = www/g' /www/wdlinux/nginx_php-${Ver}/etc/php-fpm.conf

sed -i 's/;pid =/pid =/g' /www/wdlinux/nginx_php-${Ver}/etc/php-fpm.conf

sed -i "s/127.0.0.1:9000/127.0.0.1:900${X}/g" /www/wdlinux/nginx_php-${Ver}/etc/php-fpm.conf

cp -f sapi/fpm/init.d.php-fpm /www/wdlinux/init.d/php-${Ver}

chmod 755 /www/wdlinux/init.d/php-${Ver}

ln -s /www/wdlinux/init.d/php-${Ver} /etc/init.d/

if [ ! -d /www/wdlinux/nginx_php-${Ver}/lib/php/extensions ];then

mkdir -p /www/wdlinux/nginx_php-${Ver}/lib/php/extensions/no-debug-zts-20100525

ln -sf /www/wdlinux/nginx_php-${Ver}/lib/php/extensions/no-debug-zts-20100525 /www/wdlinux/nginx_php-${Ver}/lib/php/extensions/no-debug-non-zts-20100525

fi

service php-${Ver} start

echo

echo "php-${Ver} update is OK"

fi

echo

php5.4,5.5,5.6 php-fpm端口9004 9005 9006 下载链接:5.3脚本下载地址:http://www.gotoip.top/download/php_up54.sh

命令:5.4:sh php_up54.sh

5.5:shphp_up54.sh5.5.32

5.6:shphp_up54.sh5.6.18

设置站点不同php

在wdcp网站后台,设置web引擎为nginx

6332e926078f03d4cb8bcaad49a0f844.png

在到需要使用该php版本的站点,网站管理-站点列表-文管

930aee5df36f2b76ec1f6cbbb62bb7ed.png

点击nginx站点配置

0a2732d50994146c759251577b67b6c2.png

找到站点对应站点的配置文件*.conf,进入编辑

d917b81b0e1190fa24a582caeaf56076.png

修改php-fpm的监听端口,之前5.3脚本使用的是9003,,将原来php5.2的9000端口修改为9003,保存。

9e44bfab0f71a7c89a099de408f68fa5.png

在到系统管理-服务重启中重启web附图。

cf985de4b1a0714af71118ee721c5b40.png

f54366b52119e8929081b105775b82d6.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值