#进入扩展包目录
cd /data/soft/php-5.5.38/ext/mysqli
#生成 configure 文件
/usr/local/php/bin/phpize
#执行 configure
./configure --prefix=/usr/local/lib --with-php-config=/usr/local/lnmp/php/bin/php-config
#编译并安装
make
##可能出现以下错误
/usr/local/php/include/php/main/…/main/php_config.h:2113:1: warning: this is the location of the previous definition
/data/soft/php-5.5.38/ext/mysqli/mysqli_api.c:36:47: error: ext/mysqlnd/mysql_float_to_double.h: No such file or directory
make: *** [mysqli_api.lo] Error 1
##解决方法:
vim mysqli_api.c
将 #include “ext/mysqlnd/mysql_float_to_double.h”
修改为 #include “/data/soft/php-5.5.38/ext/mysqlnd/mysql_float_to_double.h”
然后重新 make
最后 make install
#修改 php.ini
extension_dir="/usr/local/lnmp/php/lib/php/extensions/no-debug-non-zts-20131226/"
extension=mysqli.so