yum install -y wget autoconf
wget -P /lib64 http://47.90.101.26/linux/php/libmysqlclient.so.18
yum install -y libXpm

cd /root
wget http://47.90.101.26/linux/nginx/install_nginx1.12_for_centos7.sh
sh install_nginx1.12_for_centos7.sh
sh install.sh

cd /root/software
wget http://47.90.101.26/linux/php/php5_nginx_install.tar.gz
tar zxf php5_nginx_install.tar.gz
cd php5_nginx_install
sh install.sh

cd /root/software
curl -O http://47.90.101.26/linux/php/php-5.6.30.tar.gz
tar zxf php-5.6.30.tar.gz

cd /root/software
#安装freetds
wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.1.24.tar.gz
tar -zxvf freetds-1.1.24.tar.gz
cd freetds-1.1.24
./configure --prefix=/opt/freetds
make && make install

#安装libevent扩展
cd /root/software
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -zxvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/opt/libevent
make && make install

######################
cd /root/software
wget http://pecl.php.net/get/libevent-0.1.0.tgz
tar -zxvf libevent-0.1.0.tgz
cd libevent-0.1.0/
/opt/php/bin/phpize 
./configure --with-php-config=/opt/php/bin/php-config --with-libevent=/opt/libevent/
make && make install

#安装posix扩展
cd /root/software/php-5.6.30/ext/posix/
/opt/php/bin/phpize 
./configure --with-php-config=/opt/php/bin/php-config
make && make install

#安装mssql扩展
cd /root/software/php-5.6.30/ext/mssql/
/opt/php/bin/phpize
./configure --with-php-config=/opt/php/bin/php-config --with-mssql=/opt/freetds/
make && make install

#安装pdo_dblib扩展
cd /root/software/php-5.6.30/ext/pdo_dblib/
/opt/php/bin/phpize
./configure --with-php-config=/opt/php/bin/php-config --with-pdo-dblib=/opt/freetds/
make && make install

#增加PHP扩展redis
cd /root/software/
wget https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
tar zxvf 2.2.4.tar.gz
cd /root/software/phpredis-2.2.4
/opt/php/bin/phpize
./configure --with-php-config=/opt/php/bin/php-config
make && make install

#安装openssl扩展
cd /root/software/php-5.6.30/ext/openssl/
mv config0.m4 config.m4
/opt/php/bin/phpize
./configure --with-openssl --with-php-config=/opt/php/bin/php-config
make && make install

#安装pdo_obdc扩展
yum -y install unixODBC-*
cd /root/software/php-5.6.30/ext/pdo_odbc/
/opt/php/bin/phpize
./configure --with-php-config=/opt/php/bin/php-config --with-pdo-odbc=unixODBC,/usr
make && make install

#配置php支持
cat <<EOT >> /opt/php/etc/php.ini
extension ="mssql.so"
extension ="pdo_dblib.so"       
extension ="redis.so" 
extension ="openssl.so"       
extension ="pdo_odbc.so"
extension ="libevent.so"
EOT

systemctl start ntpd
timedatectl set-timezone Asia/Shanghai
