linux如何安装php扩展脚本

发布时间:2021-09-05 12:37:34 作者:小新
来源:亿速云 阅读:140

这篇文章将为大家详细讲解有关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

关于“linux如何安装php扩展脚本”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

推荐阅读:
  1. 安装php扩展
  2. linux下安装php扩展memcache

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

linux php

上一篇:javascript中eval怎么用

下一篇:React的React.FC与React.Component的用法

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》