pear php5.6,一键安装php5.6.40脚本

#!/bin/bash

#安装依赖软件

yum -y install libxml2-devel curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel net-snmp net-snmp-devel

#安装libiconv-1.14(下面使用sed增加2行,不增加会报错,详细查看www.cnblogs.com/blog-tim/p/10537708.html)

cd /usr/local/src/

wget -c http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

tar -xf libiconv-1.14.tar.gz

sed -i ‘697a #if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)‘ /usr/local/src/libiconv-1.14/srclib/stdio.in.h

sed -i ‘699a #endif‘ /usr/local/src/libiconv-1.14/srclib/stdio.in.h

cd libiconv-1.14

./configure --prefix=/usr/local/php/libiconv && make && make install

#安装libmcrypt-2.5.8

cd /usr/local/src/

wget -c http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz

tar -xf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8

./configure && make && make install

/sbin/ldconfig && cd libltdl/

./configure --enable-ltdl-install && make && make install

#安装mhash-0.9.9.9

cd /usr/local/src/

wget -c http://nchc.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz

tar -xf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9

./configure && make && make install

#安装mcrypt-2.6.8

cd /usr/local/src/

wget -c http://nchc.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz

tar -xf mcrypt-2.6.8.tar.gz

cd mcrypt-2.6.8

/sbin/ldconfig && export LD_LIBRARY_PATH=/usr/local/lib: LD_LIBRARY_PATH

./configure && make && make install

#编译安装php-5.6.40

cd /usr/local/src/

wget -c http://jp2.php.net/distributions/php-5.6.40.tar.gz

tar -xf php-5.6.40.tar.gz

cd php-5.6.40

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-iconv=/usr/local/php/libiconv --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gd --with-jpeg-dir --with-png-dir --with-pear --with-freetype-dir --with-zlib --with-libxml-dir --with-iconv-dir --with-xmlrpc --with-mhash --with-mcrypt --with-curl --with-openssl --with-snmp --with-gettext --enable-pdo --enable-mbstring --enable-ctype --enable-simplexml --enable-ftp --enable-sockets --enable-gd-native-ttf --enable-sysvsem --enable-exif --enable-sysvshm --enable-xml --enable-dom --enable-simplexml --enable-shmop --enable-zip --enable-mbregex --enable-bcmath --enable-inline-optimization --enable-soap

make && make install

#配置php和环境变量,关闭httpd服务

cp php.ini-production /usr/local/php/etc/php.ini

echo "export PATH=/usr/local/php/bin:$PATH" >>/etc/profile

source /etc/profile

killall -9 httpd

#配置php首页,然后重新启动httpd服务

rm -f /var/www/html/index.html

cat > /var/www/html/index.php << EOF

phpinfo()

?>

EOF

/usr/local/apache/bin/apachectl start

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值