阿里云一键安装包,默认安装 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