码迷,mamicode.com
首页 > Web开发 > 详细

一键安装php5.6.40脚本

时间:2019-03-15 19:04:28      阅读:1575      评论:0      收藏:0      [点我收藏+]

标签:dex   bic   Fix   index.php   .so   ati   pen   安装php   mha   

#!/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
<?php
phpinfo()
?>
EOF
/usr/local/apache/bin/apachectl start

 

一键安装php5.6.40脚本

标签:dex   bic   Fix   index.php   .so   ati   pen   安装php   mha   

原文地址:https://www.cnblogs.com/blog-tim/p/10538573.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!