不按装mysql情况下,php安装pdo_mysql

安装pdo时遇到 --with-pdo-mysql  这个要指向mysql安装目录;可是我这台机器不安装mysql;
解决方法:
[root@localhost app]#  yum install mysql-devel  
在次检测编译
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr
 
原因是:
即便我们不按装mysql服务,但也得安装mysql客户端mysql-devel ;      否则 mysql.h头找不到,导致报错;

 

 

/usr/local/src/php-7.2.7/ext/pdo_mysql/pdo_mysql.c: In function ‘zm_startup_pdo_mysql’:
/usr/local/src/php-7.2.7/ext/pdo_mysql/pdo_mysql.c:138: error: ‘pdo_mysql_reverse_api’ undeclared (first use in this function)
/usr/local/src/php-7.2.7/ext/pdo_mysql/pdo_mysql.c:138: error: (Each undeclared identifier is reported only once
/usr/local/src/php-7.2.7/ext/pdo_mysql/pdo_mysql.c:138: error: for each function it appears in.)
make: *** [pdo_mysql.lo] Error 1

 

posted @ 2018-07-31 14:51  liuyp99999  阅读(917)  评论(0编辑  收藏  举报