wdcp的安装扩展模块

其实就是官方包里面的所有附加模块全部支持啦.~~
是在官方的基础上修改的
优化了每次都解压缩php源码包,按需解压缩
使用方法如下
wget http://git.oschina.net/loblog/memcache/raw/master/ext.sh
sh ext.sh
然后选择php版本
接下来选择要编译的模块,直接输入模块名即可

目前官方2个版本,这里也是两个,和官方同步
另外说下,官方php5.3是5.3.17,官方写的5.3.27.不知道为什么,可能手误吧.我也没有纠正,是便于同步,见谅~~

 

ext.sh内容

 

 

#!/bin/bash
# ext install scripts
# Author:sendsky
# Url http://www.baiup.com/

echo "Select php version:
1 php-5.2.17 (default)
2 php-5.3.27
"
sleep 0.1
read -p "Please Input 1,2: " PHP_VER_ID
if [[ $PHP_VER_ID == 2 ]]; then
PHP_VER="5.3.27"
ext_dir="no-debug-non-zts-20090626"
else
PHP_VER="5.2.17"
ext_dir="no-debug-zts-20060613"
fi
echo "Select php ext:
bcmath gd mysqlnd posix sybase_ct
bz2 gettext oci8 pspell sysvmsg
calendar gmp odbc readline sysvsem
com_dotnet hash openssl recode sysvshm
ctype iconv pcntl reflection tidy
curl imap pcre session tokenizer
date interbase pdo shmop wddx
dba intl pdo_dblib simplexml xml
dom json pdo_firebird skeleton xmlreader
enchant ldap pdo_mysql snmp xmlrpc
ereg libxml pdo_oci soap xmlwriter
exif mbstring pdo_odbc sockets xsl
mcrypt pdo_pgsql spl zip standard
fileinfo mssql pdo_sqlite sqlite zlib
filter mysql pgsql sqlite3
ftp mysqli phar
"
sleep 0.1
read -p "Please Input ext name: " PHP_EXT

TOP=$(cd $(dirname $0)/.. && pwd)

if [ ! -f /usr/bin/gcc ]; then
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 sudo bzip2
fi

if [ -d $TOP/lanmp/php-$PHP_VER/ext/$PHP_EXT ]; then
cd $TOP/lanmp/php-$PHP_VER/ext/$PHP_EXT
else
cd /tmp
if [ ! -d php-$PHP_VER ]; then
wget -c http://dl.wdlinux.cn:5180/soft/php-$PHP_VER.tar.gz
tar zxvf php-$PHP_VER.tar.gz
fi
fi

if [ ! -d php-$PHP_VER/ext/$PHP_EXT ]; then
echo "Ext no fount!!"
exit
fi

cd php-$PHP_VER/ext/$PHP_EXT
/www/wdlinux/php/bin/phpize
./configure --with-php-config=/www/wdlinux/php/bin/php-config
make
[ $? != 0 ] && exit
make install
echo
grep -q "$ext_dir" /www/wdlinux/etc/php.ini
if [ $? != 0 ]; then
echo '' >> /www/wdlinux/etc/php.ini
echo "extension_dir=/www/wdlinux/php/lib/php/extensions/$ext_dir" >> /www/wdlinux/etc/php.ini
fi
grep "$PHP_EXT.so" /www/wdlinux/etc/php.ini
if [ $? != 0 ]; then
echo '' >> /www/wdlinux/etc/php.ini
echo "extension=$PHP_EXT.so" >> /www/wdlinux/etc/php.ini
fi
if [ -d /www/wdlinux/apache ]; then
service httpd restart
else
service nginxd restart
fi
echo
echo "$PHP_EXT install is OK"
echo

你可能感兴趣的:(wdcp的安装扩展模块)