2022
我们一起努力

linux安装php扩展脚本分享(linux编译安装php扩展命令)

测试环境: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

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

赞(0)
文章名称:《linux安装php扩展脚本分享(linux编译安装php扩展命令)》
文章链接:https://www.fzvps.com/34121.html
本站文章来源于互联网,如有侵权,请联系管理删除,本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。
图片版权归属各自创作者所有,图片水印出于防止被无耻之徒盗取劳动成果的目的。

评论 抢沙发

评论前必须登录!