php7 安装mysqli扩展遇到的坑及解决办法

一、安装步骤

1、找到php7源码里找到ext 目录, 安装 ext目录下的mysqli

注:源码包下载可查看我的另一篇博文:https://blog.csdn.net/JineD/article/details/111562127       centos7 安装php7.4

2、输入 /usr/local/php/bin/phpize

3、在mysqli文件夹下执行 ./configure --with-php-config=/usr/local/php/bin/php-config --with-mysqli=/usr/bin/mysql_config

注:ubuntu 系统执行  ./configure --with-php-config=/usr/local/php7/bin/php-config --with-mysqli

4、make && make install

二、遇到的坑

 问题一:找不到mysql_config的话可能是没有安装mysql-devel

  yum install mysql-devel

ubuntu 安装 mysqli 拓展请看    Ubuntu为已经安装的PHP7单独编译mysqli 

问题二: 在安装mysqli的时候,出现error: ext/mysqlnd/mysql_float_to_double.h: No such file or directory

  解决步骤:

1、vim /usr/local/src/php7.4.0/ext/mysqli/mysqli_api.c   (这里找到你的php源码目录)

2、修改文件第36行的路径

    /ext/mysqlnd/mysql_float_to_double.h

    修改为

   /usr/local/src/php7.4.0/ext/mysqlnd/mysql_float_to_double.h

猜你喜欢

转载自blog.csdn.net/JineD/article/details/120504906