在源码编译php时,出现如下问题checkingwhethertoenableembeddedMySQLisupport...nocheckingformysql_set_server_optionin-lmysqlclient...noconfigure:error:wrongmysqllibraryversi...
在源码编译php时,出现如下问题
checking whether to enable embedded MySQLi support... no
checking for mysql_set_server_option in -lmysqlclient... no
configure: error: wrong mysql library version or lib not found. Check config.log for more information.
如果你是用源码包编译安装的mysql,同时又用安装包安装了mysql-devel,这时你就得检查一下你的编译参数了:
--with-mysqli=/usr/local/mysql/bin/mysql_config
本人一开始设置的路径是mysql源码安装的路径,结果一直报上面这个错误,在折腾了两个多小时后想到用find查找一下“mysql_config”这个文件,查找结果如下:
[root@localhost lib]# find / -name "mysql_config"
/etc/alternatives/mysql_config
/var/lib/alternatives/mysql_config
/usr/bin/mysql_config
/usr/lib64/mysql/mysql_config
/usr/local/mysql/bin/mysql_config
/home/zhou/tarsource/mysql-5.5.28/scripts/mysql_config
于是将--with-mysqli的路径改为:
--with-mysqli = /usr/bin/mysql_config
编译通过。
展开