Install PHP extension instance code using shell scripts

Source: Internet
Author: User
The following is a simple method for installing PHP extensions using shell scripts. I think this is quite good. now I will share it with you and give you a reference. Let's take a look at the following small series to bring you a simple method for installing PHP extensions using shell scripts. I think this is quite good. now I will share it with you and give you a reference. Let's take a look at it with Xiaobian.

Example:

#!/bin/bash#This script is to install PHP extensions#Author=steven#Email=775189187@qq.com#WriteTime=Sun Aug 14 23:32:18 CST 2016#The environment variableExtension_HOME=/usr/local/src/php-5.6.16/ext/mysqlPHP_HOME=/usr/local/webserver/phpExtension_Install=mysql.so#Enter the extension directorycd $Extension_HOME#Some of the set about PHP plugin modules$PHP_HOME/bin/phpize#Target characteristics of the test installation platform$Extension_HOME/configure --with-php-config=$PHP_HOME/bin/php-config#compilemake#installmake install#php.ini file insert the extension=$Extension_Installif grep -Fxq "extension=$Extension_Install" $PHP_HOME/etc/php.ini then    echo "extension=$Extension_Install exist " else    echo -e "\n[mysql]\nextension=$Extension_Install" >> $PHP_HOME/etc/php.inifi#restart php-fpm processkill -SIGUSR2 `cat $PHP_HOME/var/run/php-fpm.pid`

The above is the details of the instance code for installing PHP extensions using shell scripts. For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.