linux php一键包,shell脚本一键安装php7的实例(推荐)

#!/bin/bash

php_gz_file='/home/php/Downloads/source/php-7.0.0.tar.bz2'

tar_dir='/home/php/Downloads/dst/'

source_dir='php-7.0.0'

cd $tar_dir

rm -rf $source_dir

echo '===start tar php ========'

tar -jxvf $php_gz_file > /dev/null

echo '===end tar php ======='

cd $source_dir

echo '===echo start configure php======= '

./configure --prefix=/usr/local/php7 \

--with-config-file-path=/usr/local/php7/etc \

--with-config-file-scan-dir=/usr/local/php7/etc/conf.d \

--enable-fpm \

--enable-opcache \

--with-apxs2=/usr/local/apache/bin/apxs \

--with-curl \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd \

--enable-session \

--enable-mbstring \

--enable-sockets \

--with-gd \

--with-iconv \

--with-openssl \

--enable-soap \

> /dev/null

echo ' ===end configrue php===== '

echo '=== start make ==== '

make > /dev/null

echo '==end make test'

if [ $? -eq 0 ]

then

echo '===start make install==='

make install > /dev/null

echo '===end make install==='

fi

is_finsh_install=$?

if [ $is_finsh_install -eq 0 ]

then

echo '===start make test===='

make test > /dev/null

echo '===end make test====='

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

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

chmod +x /etc/init.d/php7-fpm

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

cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf

fi

echo done.....

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值