编译pdo_mysql扩展

参考文档http://php.net/manual/en/install.pecl.php

configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.


翻译即可


yum install -y re2c



configure: error: mysql_query missing!?

缺少mysql-client开发库


yum install -y mysql-devel
yum install -y mysql-libs


/usr/local/src/php/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:25:19: 错误:mysql.h:没有那个文件或目录


这是由于php_pdo_mysql_int.h头文件使用相对路径包含mysql.头文件,且当前目录也不存在mysql.h文件,其它mysql的头文件找不到的解决方法一样


find / -name mysql.h #找到这个文件,确定路径



编辑 php_pdo_mysql_int.h替换mysql.h头文件的路径


vim /usr/local/src/php/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h
#用find找到的路径替换php_pdo_mysql_int.h中mysql.h头文件


编辑php.ini 添加扩展即可



你可能感兴趣的:(编译pdo_mysql扩展)