linux安装php扩展脚本分享

本站所有内容来自互联网收集,仅供学习和交流,请勿用于商业用途。如有侵权、不妥之处,请第一时间联系我们删除!Q群:迪思分享

免费资源网 – https://freexyz.cn/

测试环境: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 doesnt exist in current directory.n” && exit 0

[ ! -d “skeleton” ] && echo “The directory of skeleton doesnt 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

免费资源网 – https://freexyz.cn/


© 版权声明
THE END
★喜欢这篇文章吗?喜欢的话,麻烦动动手指支持一下!★
点赞7 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容