shell指令碼一鍵安裝php7的執行個體

來源:互聯網
上載者:User
下面小編就為大家帶來一篇shell指令碼一鍵安裝php7的執行個體(推薦)。小編覺得挺不錯的,現在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

如下所示:

#!/bin/bashphp_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_dirrm -rf $source_direcho '===start tar php ========'tar -jxvf $php_gz_file > /dev/nullecho '===end tar php ======='cd $source_direcho '===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 ]thenecho '===start make install==='make install > /dev/nullecho '===end make install==='fiis_finsh_install=$?if [ $is_finsh_install -eq 0 ]thenecho '===start make test===='make test > /dev/nullecho '===end make test====='cp php.ini-production /usr/local/php7/etc/php.inicp sapi/fpm/init.d.php-fpm /etc/init.d/php7-fpmchmod +x /etc/init.d/php7-fpmcp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.confcp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conffiecho done.....

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.