CentOS 6 php5.6.0一键部署脚本
admin
2023-06-19 02:22:04
0

目标:一键部署php5.6.0版本

环境:CentOS 6 64位 桌面版本

软件包:链接:http://pan.baidu.com/s/1jIyZrRS 密码:q9uu


[root@salt-master home]# cat php.sh 

#/bin/bash

#

#CentOS 6

#

. /etc/init.d/functions

dir=/root/test

del_dir() {

read -p "需要删除${dir} 是否删除[Y|y/N|n]:" del

case $del in

Y|y)

rm -rf $dir

mkdir $dir

cd $dir

;;

N|n)

echo "安装终止"

exit 7

;;

*)

echo "请输入正确的值"

exit 8

;;

esac

}

[ ! -d $dir ] && {

mkdir $dir

cd $dir

} || del_dir

wget http://172.2.0.68/freetype-2.3.10.tar.bz2

wget http://172.2.0.68/jpegsrc.v7.tar.gz

wget http://172.2.0.68/libpng-1.2.41.tar.bz2

wget http://172.2.0.68/libiconv-1.14.tar.gz

wget http://172.2.0.68/gd-2.0.33.tar.gz

wget http://172.2.0.68/libmcrypt-2.5.7.tar.gz 

wget http://172.2.0.68/zlib-1.2.8.tar.gz 

wget http://172.2.0.68/php-5.6.0.tar.gz

yum -y install libjpeg-devel libpng-devel freetype-devel libxml2-devel zlib-devel glibc-devel glib2-devel bzip2-devel ncurses ncurses-devel curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel

tar jxvf freetype-2.3.10.tar.bz2

cd freetype-2.3.10

./configure --prefix=/usr/local/freetype

make && make install

cd ..

tar -xzvf jpegsrc.v7.tar.gz

cd jpeg-7/

./configure --prefix=/usr/local/jpeg

make && make install

cd ..

tar jvxf libpng-1.2.41.tar.bz2

cd libpng-1.2.41

./configure --prefix=/usr/local/libpng

make && make install

cd ..

tar -zxvf libiconv-1.14.tar.gz

cd libiconv-1.14 

./configure --prefix=/usr/local/libiconv

make && make install

cd ..

ln -s /usr/local/libpng/include/pngconf.h /usr/include

ln -s /usr/local/libpng/include/png.h /usr/include

tar -xzvf gd-2.0.33.tar.gz

cd gd-2.0.33

./configure --prefix=/usr/local/gd2 --with-freetype=/usr/local/freetype --with-png=/usr/local/libpng --with-jpeg=/usr/local/jpeg

[ $? -eq 0 ] && {

make && make install

} || {

echo "安装gd出错..........."

exit 8

}

cd ..

tar -xzvf libmcrypt-2.5.7.tar.gz 

cd libmcrypt-2.5.7

./configure --prefix=/usr/local/libmcrypt

make && make install

cd ..

tar -zxvf zlib-1.2.8.tar.gz 

cd zlib-1.2.8

./configure --prefix=/usr/local/zlib

make && make install

cd ..

ln -s /usr/local/libmcrypt/include/mcrypt.h /usr/include/

ln -s /usr/local/libmcrypt/lib/* /usr/local/lib/

echo "/usr/local/lib" >> /etc/ld.so.conf

ldconfig

tar -zxvf php-5.6.0.tar.gz

cd php-5.6.0

./configure -prefix=/usr/local/php --with-config-file-path=/etc --with-gd --with-png-dir --with-jpeg-dir --with-freetype-dir --enable-fpm --with-mcrypt --with-zlib --enable-mbstring --disable-pdo --with-curl --disable-rpath --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --with-mhash --enable-zip --with-pcre-regex --with-mysql --disable-fileinfo

[ $? -eq 0 ] && {

make && make install

} || {

echo "编译失败....."

exit 8

}

cp sapi/fpm/init.d.php-fpm  /etc/init.d/php-fpm

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

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

chmod 700 /etc/init.d/php-fpm

chkconfig --add php-fpm

chkconfig --level 35 php-fpm on


相关内容

热门资讯

日本情报体系加速重构,《反间谍... 澎湃新闻记者 陈沁涵日本国会参议院全体会议5月27日表决通过“国家情报会议”设立法案。这被视为日本首...
教育部:这类学历不予认证 不出... 教育部:这类学历不予认证  【教育部:这类学历不予认证】“不出国就能拿国外文凭,国家还认证”,这种话...
“同享老婆梅”“同享情人梅”包... 近日,四川一女子看到网上销售的“同享老婆梅”零食外包装上刻有“同享老婆梅”“同享情人梅”等字样,认为...
郑州商超江湖加速迭代焕新!5月... 当四季轮回由冬到夏,当路边法桐从枝丫光秃到绿意盎然,郑州市东风路与丰乐路交叉口东南角,那个曾经对市民...
无人机挂横幅向政府讨债,别把企... 评论员 李一木据上游新闻报道,近日,一段内容为“无人机挂横幅向山东济南市商河县农业农村局讨债”的视频...
伊朗革命卫队官员:伊美战争重启... 据伊朗方面27日消息,伊朗伊斯兰革命卫队海军官员穆罕默德·阿克巴尔扎德表示,与美国重新发生战争的可能...
母亲虐待并强迫女儿拍隐私部位出... 近日,最高法发布了六起防范和惩治家庭内部侵害未成年人合法权益典型案例。其中一起案例中,当妈的田某某长...
多点发力精准辟谣 郑州全方位筑... 5月26日,“每一件举报,都是共治的力量”2026年度网络举报系列宣传活动(河南站)在郑州启动。顶端...
我国冷原子干涉重力测量取得突破... 记者今天(5月27日)了解到,“十四五”期间,市场监管总局组织国内优势技术团队,开展冷原子干涉重力仪...
林志玲辞去职务 国台办:明智决...  林志玲辞去职务 国台办:明智决定  【林志玲辞去职务 国台办:明智决定】5月27日,国台办回应林志...