WenRou's Blog

新浪微薄腾讯微薄

最新碎语:测试图片碎语哦

您的位置:WenRou's Blog >面板> kangle安装fileinfo扩展完善版(PHP7.3.7)

kangle安装fileinfo扩展完善版(PHP7.3.7)

kangle安装fileinfo扩展完善版(PHP7.3.7)
1、下载PHP(根据已安装的php下载对应的版本,我已经安装了php-7.3.7版本,所以选择下载php-7.3.7.tar.gz)
wget -O php-7.3.7.tar.gz http://cn2.php.net/get/php-7.3.7.tar.gz/from/this/mirror
2、解压
tar -zxvf php-7.3.7.tar.gz
(如果下载的是 tar.bz2 格式的压缩包,则使用 tar -xjf php-7.3.7.tar.bz2 命令)
3、修改php-config使的能够编译安装fileinfo扩展
   进入 vhs/kangle/ext/tpl_php737/bin 修改php-config 将--disable-fileinfo'修改成--enable-fileinfo'
4、进入对应php版本扩展目录(我这是php-7.3.7版本)
cd /root/php-7.3.7/ext/fileinfo
5、执行phpize生成.configure文件
/vhs/kangle/ext/tpl_php737/bin/phpize   (注意你的目录可能与我的不一样,修改成你自己的即可)


5.1 这里需要注意:

我原来 php5.6.33版本安装fileinfo扩展的时候很顺利,
但是php7.3.7执行phpize的时候提示出现以下问题:
PHP Api Version: 20180731
Zend Module Api No: 20180731
Zend Extension Api No: 320180731
configure.ac:3: error: Autoconf version 2.68 or higher is required
configure.ac:3: the top level
autom4te: /usr/bin/m4 failed with exit status: 63
解决方案:Autoconf需要更高版本
linux安装autoconf-2.69
检查是否有安装autoconf其他版本:
rpm -qf /usr/bin/autoconf
如有安装,则先卸载相应版本,否则不用处理。执行以下命令卸载:
rpm -e --nodeps autoconf-2.63
下载:
wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
解压安装:
tar zxvf autoconf-2.69.tar.gz
编译源文件:
cd autoconf-2.69
./configure --prefix=/usr/

make && make install


5.2 这里也可能会出新问题,没有问题的直接跳到5.3

出现:configure: error: no acceptable m4 could be found in $PATH

解决:
m4的版本越高越难安装,因此按照所需最低版本进行安装


(1)在网站下载 m4-1.4.6.tar.gz



ftp.gnu.org/gnu/m4

(2)解压文件

gunzip m4-1.4.6.tar.gz
tar -xvf m4-1.4.6.tar

(3)进入目录

cd m4-1.4.16/

(4)配置

sudo ./configure

(5)编译

sudo make

(6)安装

sudo make install



5.3 检查版本:
/usr/bin/autoconf -V
那么重新再执行

cd /root/php-7.3.7/ext/fileinfo


/vhs/kangle/ext/tpl_php737/bin/phpize
应该没有问题了,


6、配置文件:
./configure -with-php-config=/vhs/kangle/ext/tpl_php737/bin/php-config
7、编译安装:
make && make install
等待编译完成即可!

8、修改php.ini文件
也就是在/vhs/kangle/ext/tpl_php5633/php-templete.ini 文件的后面加入extension = "fileinfo.so" 保存文件

9、重启kangle
/vhs/kangle/bin/kangle -r
如果没反应可以使用:service kangle restart

---

转载请注明本文标题和链接:《kangle安装fileinfo扩展完善版(PHP7.3.7)

发表评论

92 + 1 =
路人甲 表情
看不清楚?点图切换 Ctrl+Enter快速提交