找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 18|回复: 2

WDCP升级php5.4开启mysqli

[复制链接]

62

主题

1075

回帖

2354

积分

金牌会员

积分
2354
发表于 2013-3-29 21:38:10 | 显示全部楼层 |阅读模式
话说一开始发现WDCP没有mysqli还不敢相信,竟然木有mysqli太有意思了。
官方脚本升级有5.3的,但是木有5.4的。
直接修改版本好会404,原因是wdcp的升级脚本是从官方下载的,我们只要稍改动,就OK了,下面是我修改的脚本供大家参考

#!/bin/bash

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

###
Ver=5.4.13
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

###
tar zxvf php-${Ver}.tar.gz
cd php-${Ver}
if [ -d /www/wdlinux/apache_php ];then
make clean
./configure –prefix=/www/wdlinux/apache_php-${Ver} –with-config-file-path=/www/wdlinux/apache_php-${Ver}/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 –enable-ftp –enable-sockets –enable-zip –with-apxs2=/www/wdlinux/apache/bin/apxs
[ $? != 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/apache_php-${Ver}/etc/php.ini
#grep ‘\[eaccelerator\]‘ -A15 /www/wdlinux/apache_php/etc/php.ini >> /www/wdlinux/apache_php-${Ver}/etc/php.ini
#grep ‘\[Zend\]‘ -A5 /www/wdlinux/apache_php/etc/php.ini >> /www/wdlinux/apache_php-${Ver}/etc/php.ini
sed -i ‘s/short_open_tag = Off/short_open_tag = On/g’ /www/wdlinux/apache_php-${Ver}/etc/php.ini
rm -f /www/wdlinux/apache_php
ln -sf /www/wdlinux/apache_php-${Ver} /www/wdlinux/apache_php
service httpd restart
echo
echo “php update is OK”
fi

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-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 –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-${Ver}/etc/php.ini
#grep ‘\[eaccelerator\]‘ -A15 /www/wdlinux/nginx_php/etc/php.ini >> /www/wdlinux/nginx_php-${Ver}/etc/php.ini
#grep ‘\[Zend\]‘ -A5 /www/wdlinux/nginx_php/etc/php.ini >> /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/etc/php-fpm.conf
sed -i ‘s/group = nobody/group = www/g’ /www/wdlinux/nginx_php/etc/php-fpm.conf
sed -i ‘s/;pid =/pid =/g’ /www/wdlinux/nginx_php/etc/php-fpm.conf
cp -f sapi/fpm/init.d.php-fpm /www/wdlinux/init.d/php-fpm
chmod 755 /www/wdlinux/init.d/php-fpm
service php-fpm start
echo
echo “php update is OK”
fi
echo





话说WDCP其实不咋的,,早知道还是用军哥的lnmp了。。。
回复

使用道具 举报

5

主题

139

回帖

295

积分

中级会员

积分
295
发表于 2013-3-29 21:41:58 | 显示全部楼层
wdcp不喜欢
回复

使用道具 举报

378

主题

5706

回帖

1万

积分

论坛元老

积分
12580
发表于 2013-3-29 21:47:05 | 显示全部楼层
wdcp用了一次就……
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Discuz! X

GMT+8, 2025-1-12 23:30 , Processed in 0.023775 second(s), 4 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表