首页 > 代码库 > configure: error: Cannot find php_pdo_driver.h.

configure: error: Cannot find php_pdo_driver.h.

安装pdo_mysql

cd /usr/local/src/php-5.4.0/ext/pdo_mysql/

/usr/local/php/bin/phpize   # /usr/local/php为php安装后的目录

./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/usr/local/mysql

sudo make && sudo make install

报configure: error: Cannot find php_pdo_driver.h.错误

原因是安装pdo_mysql前需要先安装pdo

cd  php5.4/ext/pdo/

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/webserver/php/bin/php-config  --enable-pdo=shared

make &&make install

 

然后

交以下几行添加至php/lib/php.ini 文件上

extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20100525/"
extension=pdo.so
extension=pdo_mysql.so

configure: error: Cannot find php_pdo_driver.h.