设为首页 收藏本站
查看: 298|回复: 0

[经验分享] php 安装configure: error: Cannot find libmysqlclient under /usr

[复制链接]

尚未签到

发表于 2017-4-5 09:37:15 | 显示全部楼层 |阅读模式
  configure: error: Cannot find libmysqlclient under /usr 解决
  php:
  http://www.rpmfind.net/linux/rpm2html/search.php?query=php (rpm)
  http://cn.php.net/get/php-5.3.0.tar.gz/from/a/mirror
  ./configure --help | grep mysql
  tar -zxvf php-5.3.0.tar.gz
  mv php-5.3.0.tar.gz php
  cd php
  rpm -Uvh MySQL-devel-standard-5.0.27-0.rhel4.x86_64.rpm
  cp /usr/lib64/mysql/* /usr/lib/mysql/ #解决
  ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/lib --enable-
  track-vars --with-xml --with-mysql --with-zlib-dir=/usr/local
  #./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/lib --enable
  -track-vars --with-xml --with-mysql=/usr/lib64/mysql --with-zlib-dir=/usr/local (不正确)
  make
  make install
  ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/lib --enable-
  track-vars --with-xml --with-mysql=/usr/lib64/mysql --with-zlib-dir=/usr/local (ok)
  今天在64位centos5.2系统上编译PHP526出错,mysql是使用的RPM方式安装的,PHP编译代码:
  ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql -enable-track-vars --enable-fastcgi 
  --disable-debug --enable-url-includes --enable-sockets --enable-force-cgi-redirect --enable-calendar --with-config-file-
  path=/etc --with-openssl --with-zlib --with-gettext --enable-magic-quotes --enable-ftp --with-ttf --with-gdbm --with-gettext 
  --with-iconv --with-xml --enable-mbstring=all
  出现一下错误:
  checking whether time.h and sys/time.h may both be included... yes
  checking for working alloca.h... (cached) yes
  checking for alloca... (cached) yes
  checking for 8-bit clean memcmp... yes
  checking for mcrypt support... no
  checking for mhash support... no
  checking whether to include mime_magic support... no
  checking for MING support... no
  checking for mSQL support... no
  checking for MSSQL support via FreeTDS... no
  checking for MySQL support... yes
  checking for specified location of the MySQL UNIX socket... no
  checking for MySQL UNIX socket location... no
  configure: error: Cannot find libmysqlclient under /usr.
  Note that the MySQL client library is not bundled anymore!
  通过查找libmysqlclient,发现是在/usr/lib64/mysql/目录内的libmysqlclient.so.15.0.0做的软连接,PHP默认是去的 /usr/lib/搜索,所以没
  有找到.找到问题了就好解决了.
  解决办法就是:
  cp -rp /usr/lib64/mysql/libmysqlclient.so.15.0.0 /usr/lib/libmysqlclient.so
  centos   : --with-mysql=/usr/lib64/mysql (香巴拉) 或者cp /usr/lib64/mysql/* /usr/lib/mysql/
  configure: error: Cannot find libmysqlclient under /usr
  Posted by alex in Errors
  I received the below error when compiling PHP to work as an external application with the Litespeed API. When you do compile 
  this it’s called the PHP LSAPI module which is then used by Litespeed to process PHP.
  PHP Build Error:
  configure: error: Cannot find libmysqlclient under /usr.
  Note that the MySQL client library is not bundled anymore!
  The issue was that I the MySQL server version was 64-bit and the php compile script was looking for 32-bit libraries. To see 
  if your MySQL server is 64-bit or 32-bit check the version by issuing the below command and looking for a response also shown 
  below.
  MySQL Version:
  [iyunv@server php-5.2.8]# mysql –version
  mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (x86_64) using readline 5.0
  To resolve the issue add the below configuration options to your PHP configure script.
  Options to Add:
  –with-mysql=/usr/bin/ –with-libdir=lib64
  So my PHP configure script after adding these options now looked like the below which resolve the compile error.
  PHP Configure Script:
  ./configure –prefix=/var/lsws/lsphp5 –with-litespeed –with-mysqli –with-mcrypt –with-mysql=/usr/bin/ –with-libdir=lib64 
  –with-zlib –with-gd –enable-shmop
  –enable-track-vars –enable-sockets –enable-sysvsem –enable-sysvshm –enable-magic-quotes –enable-mbstring –with-iconv
  Share: Click an icon below to share using one of the social networking sites below. These icons link to social bookmarking 
  sites where readers can share and discover new web pages.
  来自: http://hi.baidu.com/suping/blog/item/b82cbca1bb839882471064ac.html 

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-360384-1-1.html 上篇帖子: php 移动网站添加 google Analytics统计代码 下篇帖子: 总结下flash和php通信的学习经验
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表