shell 脚本安装PHP扩展的简单方法
实例如下:
#!/bin/bash #This script is to install PHP extensions #Author=steven #[email protected] #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`
相关推荐
Noneyes 2020-11-10
卖口粥湛蓝的天空 2020-09-15
zyyjay 2020-11-09
xuebingnan 2020-11-05
samtrue 2020-11-22
stefan0 2020-11-22
yifangs 2020-10-13
songshijiazuaa 2020-09-24
hebiwtc 2020-09-18
天步 2020-09-17
83911535 2020-11-13
whatsyourname 2020-11-13
zhouyuqi 2020-11-10
mathchao 2020-10-28
王志龙 2020-10-28
wwwsurfphpseocom 2020-10-28
diskingchuan 2020-10-23