#!/bin/bash
#
echo "PHP Installing..."
yum -y groupinstall 'X Software Development'
yum -y install libxml2-devel bzip2-devel
rpm -ivh libmcrypt-2.5.8-9.el6.i686.rpm libmcrypt-devel-2.5.8-9.el6.i686.rpm mhash-0.9.9.9-3.el6.i686.rpm mhash-devel-0.9.9.9-3.el6.i686.rpm
read -p "Please input compress type[bz2|gz]: "COMPRESS
read -p "Please input a php VERSION[php-VERSION.tar.$COMPRESS]:" PHPVER
while ! echo $PHPVER | grep "[![:alpha:]]*" &> /dev/null ; do
read -p "Please input a PHP version[php-"VERSION".tar.$COMPRESS]: " PHPVER
done
tar xf php-$PHPVER.tar.$COMPRESS
cd /root/php-$PHPVER
#cd /root/php-5.5.30
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --enable-fpm --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2
make && make test && make install
cp php.ini-production /etc/php.ini
#配置pfm
cp sapi/fpm/init.d.php-fpm /etc/rc.d/init.d/php-fpm
chmod +x /etc/rc.d/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
#提供配置文件
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
sed -i 's@^\(pm.max_children = \).*@\150@' /usr/local/php/etc/php-fpm.conf
sed -i 's@^\(pm.start_servers = \).*@\15@' /usr/local/php/etc/php-fpm.conf
sed -i 's@^\(pm.min_spare_servers = \).*@\12@' /usr/local/php/etc/php-fpm.conf
sed -i 's@^\(pm.max_spare_servers = \).*@\18@' /usr/local/php/etc/php-fpm.conf
sed -i 's@^;pid = .*@pid = /usr/local/php/var/run/php-fpm.pid@' /usr/local/php/etc/php-fpm.conf
创新互联专注于仲巴企业网站建设,
自适应网站建设,
购物商城网站建设。仲巴网站建设公司,为仲巴等地区提供建站服务。全流程定制开发,专业设计,全程项目跟踪,创新互联专业和态度为您提供的服务
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
文章名称:初次尝试利用脚本自动编译搭建LAMP-----php-创新互联
文章地址:
http://cdxtjz.cn/article/dhched.html