shell 脚本安装PHP扩展的简单方法
程序员文章站
2022-03-18 11:57:17
实例如下:
#!/bin/bash
#this script is to install php extensions
#author=steven
#em...
实例如下:
#!/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 脚本安装php扩展的简单方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。