最新消息:走过的,离开的,已经错过,新开始2016

阿里云 一键安装包 php升级 5.4

技术随笔 果果 11534浏览 3评论

阿里云一键安装包,默认安装 php 5.2.17  但有客户要高版本,安装包里面已经带了5.3  所以写了一个 php5.4.17

安装包下载


#!/bin/bash
# guoguo's blog #
# http://www.guoguo.it #
###yum
yum install -y libmcrypt-devel libjpeg-devel libpng-devel freetype-devel curl-devel openssl-devel libxml2-devel libxml2

###
Ver=5.4.17
if [ ! -f php-${Ver}.tar.gz ];then
 wget -c http://hk2.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
mv /alidata/server/httpd/modules/libphp5.so /alidata/server/httpd/modules/libphp5.so_5.2
###
tar zxvf php-${Ver}.tar.gz
cd php-${Ver}
if [ -d /alidata/server/php ];then
make clean
./configure --prefix=/alidata/server/php-${Ver} --with-config-file-path=/alidata/server/php-${Ver}/etc --with-apxs2=/alidata/server/httpd/bin/apxs --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-static --enable-maintainer-zts --enable-zend-multibyte --enable-inline-optimization --enable-sockets --enable-wddx --enable-zip --enable-calendar --enable-bcmath --enable-soap --with-zlib --with-iconv --with-gd --with-xmlrpc --enable-mbstring --without-sqlite --with-curl --enable-ftp --with-mcrypt --with-freetype-dir=/usr/local/freetype.2.1.10 --with-jpeg-dir=/usr/local/jpeg.6 --with-png-dir=/usr/local/libpng.1.2.8 --disable-ipv6 --disable-debug --with-openssl

[ $? != 0 ] && echo "configure err" && exit
make ZEND_EXTRA_LIBS='-liconv'
[ $? != 0 ] && echo "make err" && exit
make install
[ $? != 0 ] && echo "make install err" && exit
cp php.ini-production /alidata/server/php-${Ver}/etc/php.ini
sed -i 's/short_open_tag = Off/short_open_tag = On/g' /alidata/server/php-${Ver}/etc/php.ini
rm -f /alidata/server/php
ln -sf /alidata/server/php-${Ver} /alidata/server/php
/alidata/server/httpd/bin/httpd -k restart
echo
echo "php update is OK"
fi

有问题可以留言反馈。

转载请注明:果果.IT » 阿里云 一键安装包 php升级 5.4

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (3)

  1. mbstring/libmbfl/mbfl -I/usr/local/include -I/home/soft/php-5.4.17/ext/sqlite3/libsqlite -I/home/soft/php-5.4.17/TSRM -I/home/soft/php-5.4.17/Zend -D_REENTRANT -I/usr/local/include -g -O2 -fvisibility=hidden -pthread -DZTS -c /home/soft/php-5.4.17/ext/date/lib/parse_date.c -o ext/date/lib/parse_date.lo cc: 内部错误:已杀死 (程序 cc1) 请提交一份完整的错误报告。 具体步骤请参见 。 make: *** [ext/date/lib/parse_date.lo] 错误 1 make err 升级报错 是什么原因?
    aluan10年前 (2013-12-10)
  2. 应该是服务器内存不足了,先杀死一些不要的进程再编译,最好服务器有1G内存
    果果10年前 (2013-12-12)
  3. 不错,方法靠谱
    jackqqxu10年前 (2014-03-27)