checking for mysql_close in -lmysqlclient_r… no

在自己编辑安装php时提示 checking for mysql_close in -lmysqlclient_r… no ,看这句我看是什么mysql问题,但结果是不是它的问题呢,下面我们一起来看看.

又在折腾服务器了~记录下自己编译php5.3.24的过程,执行了以下的 configure 配置命令,代码如下:

  1. ./configure
  2. --prefix=/usr/local/php
  3. --with-config-file-path=/usr/local/php/etc
  4. --with-config-file-scan-dir=/usr/local/php/etc/conf.d
  5. --enable-fpm
  6. --with-fpm-user=webserver
  7. --with-fpm-group=webserver
  8. --with-curl
  9. --with-pear
  10. --with-gd
  11. --with-jpeg-dir
  12. --with-png-dir
  13. --with-zlib
  14. --with-xpm-dir
  15. --with-freetype-dir
  16. --with-mcrypt
  17. --with-mhash
  18. --with-mysql=/usr/local/mysql
  19. --with-mysqli=/usr/local/mysql
  20. --with-pdo-mysql=/usr/local/mysql
  21. --with-openssl
  22. --with-xmlrpc
  23. --with-xsl
  24. --with-bz2
  25. --with-gettext
  26. --disable-debug
  27. --enable-fpm
  28. --enable-exif
  29. --enable-wddx
  30. --enable-zip
  31. --enable-bcmath
  32. --enable-calendar
  33. --enable-ftp
  34. --enable-mbstring
  35. --enable-soap
  36. --enable-sockets
  37. --enable-sqlite-utf8
  38. --enable-shmop
  39. --enable-dba //开源代码phpfensi.com
  40. --enable-sysvsem
  41. --enable-sysvshm
  42. --enable-sysvmsg

遇到了如下错误:

  1. checking for mysql_close in -lmysqlclient_r... no
  2. checking for mysql_error in -lmysqlclient_r... no
  3. configure: error: mysql configure failed. Please check config.log for more information.

查证、搜索后,找到一blog,是这样的原因:

  1. See this bug report: http://www.phpfensi.com
  2. If you need libmysql, apply the patch or create the symlink.
  3. Better: Switch to mysqlnd

我也就把对于mysql,mysqli,pdo的配置选项改成了如下代码:

  1. --with-mysql=mysqlnd
  2. --with-mysqli=mysqlnd
  3. --with-pdo-mysql=mysqlnd

编译通过.