dp13668681869 2012-06-22 19:06
浏览 72
已采纳

php配置找不到-lmysqlclient

I'm trying to configure a PHP installation (5.4.3) with MYSQL (5.0.91) for use with a PHP web application that relies on the MDB2 mysql module. When I install using PEAR, pear tells me that PHP does not have the required mysql extension.

Some googling around lead me to check the PHP.ini file, in which I found that extension=php_mysql.dll was commented out. I turned this on and restarted php. PHP complains that it can't find php_mysql.dll.

I realized that this might have been because I didn't install php with the --with-sql flag turned on. Reconfiguring leaves me with the following error:

checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... /project/mullenl
checking for mysql_close in -lmysqlclient... no
checking for mysql_errno in -lmysqlclient... no
configure: error: Try adding --with-zlib-dir=<DIR>. Please check config.log for more information.

A quick look at the configuration log shows the problem:

/usr/bin/ld: cannot find -lmysqlclient

When I check my lib directory in my mysql installation the following things are present:

libdbug.a   
libmysql.imp      
libmysqlclient.so*     
libmysqlclient.so.15.0.0*      
libmysqlclient_r.so*     
libmysqlclient_r.so.15.0.0*  
libmysys.a      
libndbclient.la*  
libndbclient.so.2*
libmygcc.a  
libmysqlclient.a  
libmysqlclient.so.15*  
libmysqlclient_r.a         
libmysqlclient_r.so.15*  
libmystrings.a               
libndbclient.a  
libndbclient.so*  
libndbclient.so.2.0.0*

I'm not too sure what to do next, but really need to configure PHP in this way to support the MDB2:MYSQL module. I suspect (?) that the reason I can't do this is because I don't have the development version of MYSQL installed, but I'm not sure this is the case. Any thoughts, ideas or advise would, as always, be greatly appreciated!

  • 写回答

1条回答 默认 最新

  • drhzn3911 2012-06-22 19:12
    关注

    The php_mysql.dll extension is only used on Windows, it looks like you are on Unix/Linux.

    If you view your phpinfo(), what are your configure options?

    You can build mysql into PHP by adding --with-mysql=mysqlnd to your ./configure options.

    If you have a custom version of mysql that is compiled on the system, then specify the path to where it is installed instead of using the mysql native driver (mysqlnd) --with-mysql=/usr/lib

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥15 在现有系统基础上增加功能