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 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c