您好,欢迎来到外链网!
当前位置:外链网 » 站长资讯 » 专业问答 » 文章详细 订阅RssFeed

shell 脚本安装PHP扩展的简单方法(shell脚本安装php)

来源:互联网 浏览:47次 时间:2023-04-08

实例如下:

#!/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 variable
Extension_HOME=/usr/local/src/php-5.6.16/ext/mysql
PHP_HOME=/usr/local/webserver/php
Extension_Install=mysql.so


#Enter the extension directory
cd $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
#compile
make
#install
make install
#php.ini file insert the extension=$Extension_Install
if 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.ini
fi
#restart php-fpm process
kill -SIGUSR2 `cat $PHP_HOME/var/run/php-fpm.pid`
如何用shell脚本提取该文件内容

mg class="aligncenter" referrerPolicy="no-referrer" src="https://i04piccdn.sogoucdn.com/a7187ebfe6d919c2" alt="15分钟学会shell脚本,最简明的教程在这里">
>以上这篇shell 脚本安装PHP扩展的简单方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持站长源码网。

本文从互联网转载,来源地址:www.downzz.com/linux-shell/170774.html,原作者保留一切权利,若侵权或引用不当,请联系茶猫云(cmy.cn)删除。【茶猫云,优质云服务器提供商】