我试图在CentOS 6上用mysql_pdo编译PHP,而且我只有一个时间试着去实现它。 目前我正在编译PHP 5.2,但是我将不得不为5.3做这个,因为我需要更改版本。
这是我使用的configuration命令:
./configure --with-apxs2 --with-mysql --with-mysqli --with-curl -enable-soap -enable-sockets --enable-mbstring --with-gd --with-mcrypt --with-pdo-mysql=/usr/bin/mysql
我从一个仓库安装了MySQL和mysql-devel,我得到的错误如下:
configure: error: PDO_MYSQL configure failed. Please check config.log for more information
当我检查config.log,我看到的最后一行是:
configuration:72788:在-lmysqlclient中检查mysql_query
我有一种感觉,我正在使用–with-pdo-mysql的错误值,但我试过不给它一个path或告诉它使用mysqlnd,我得到一个错误,说它无法findMySQL,如果我把它留给空白,当我把path放进去的时候也给了我同样的错误。
有人有主意吗?
编辑:我不知道这是否相关,但我发现我有位于/ usr / lib / mysql的libmysqlclient.so文件。
尽量避免从源头安装软件,这是一个不好的做法。 我build议安装IUS社区回购 。 之后,只需安装必要的软件包
# yum install php53u-pdo.x86_64 php53u-mysql.x86_64