linux安装php扩展脚本分享
2018-10-12 13:59
751 查看
测试环境:ubuntu 12.04 php 5.3.x
#!/bin/bash
#Program:
# Accomplish to expand the specified function only one key
#History:
# 2013/11/15 pankai<530911044@qq.com> first release
test ! -f ./ext_skel && echo "The shell script of 'ext_skel' doesn't exist in current directory.\n" && exit 0
[ ! -d "skeleton" ] && echo "The directory of 'skeleton' doesn't exist in current directory.\n" && exit 0
#include "./ext_skel"
read -p "Please input the extension name: " ext_name
#echo -e "hello $ext_name"#The blank space is necessary
#Error:
# like: if[ ! -d "$ext_name" ]; then
if [ ! -d "$ext_name" ]; then
./ext_skel --extname=$ext_name
fi
file="./$ext_name/config.m4"
copy="./$ext_name/config"
if [ ! -f "./$ext_name/configs" ]; then
# Create a new file and clear it if it exists
:> "$copy"
cat "$file" | while read line
#for line in $( cat ./zend/config.m4 )
do
string=$( echo $line | grep 'PHP_ARG_ENABLE' )
if [ "$string" != "" ]; then
echo $line | cut -c5- >> $copy
read line
echo $line | cut -c5- >> $copy
read line
echo $line | cut -c5- >> $copy
read line
fi
echo $line >> $copy
done
mv "$file" "./$ext_name/configs"
mv "$copy" "./$ext_name/config.m4"
fi
cd $ext_name
phpize
./configure
您可能感兴趣的文章:
相关文章推荐
- linux安装php扩展脚本分享
- Linux下手动编译安装PHP扩展的例子分享
- Linux下安装Redis php-redis扩展 redis重启shell脚本 超详细!
- linux下安装php的imagick扩展模块(附php升级脚本)
- PHP zip扩展Linux下安装过程分享
- Linux下手动编译安装PHP扩展的例子分享
- 在linux系统中利用phpize脚本安装php扩展模块
- linux下安装php的imagick扩展模块(附php升级脚本)
- PHP zip扩展Linux下安装过程分享
- Linux Xshell4下编译安装php mongodb扩展经验分享
- linux下安装php,apache扩展
- linux下Redis与phpredis扩展安装
- Linux下的Memcache安装 PHP扩展memcache
- Linux php安装zip扩展
- linux下php扩展curl的安装
- linux下 安装 ImageMagick 及其 php imagick扩展
- linux(fedora)下freetds编译安装及编译php的mssql扩展
- linux下安装php扩展curl
- linux下php扩展pdo编译安装
- linux 下编译安装php mongodb扩展