`
cocos
  • 浏览: 392668 次
  • 性别: Icon_minigender_1
  • 来自: 福州
社区版块
存档分类
最新评论

php 安装configure: error: Cannot find libmysqlclient under /usr

阅读更多

 

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:

[root@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 

 

分享到:
评论

相关推荐

    安装lamp报错信息及解决方法

    usr/bin/ld: cannot find -lltdl /usr/bin/ld: cannot find -lmysqlclient httpd: Syntax error on line 57 of /etc/httpd/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/...

    编译PHP报错configure error Cannot find libmysqlclient under usr的解决方法

    ./configure --prefix=/usr/local/php --with-mysql --with-apxs2=/usr/local/apache/bin/apxs --with-openssl --with-curl --enable-xml --with-mcrypt --with-ttf --enable-magic-quotes --enable-fastcgi --...

    svn安装过程中遇到错误需要的文件包

    错误 configure: error: could not find library containing RSA_new: 错误 configure: error: no XML parser was found: expat or libxml 2.x required 解放方法: ...

    PHP编译安装中遇到的两个错误和解决方法

    一、PHP configure: error: Cannot find ldap libraries in /usr/lib 今天在CentOS 64位下编译安装PHP5.4.8。结果在configure的时候提示 configure: error: Cannot find ldap libraries in /usr/lib 提示在/usr/lib ...

    nginx安装教程

    # 安装PCRE库 cd /usr/local/src sudo wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.41.tar.gz sudo tar -zxvf pcre-8.41.tar.gz cd pcre-8.41 sudo ./configure sudo make sudo make ...

    为PHP安装imagick时出现Cannot locate header file MagickWand.h错误的解决方法

    checking for MagickWand.h header file… configure: error: Cannot locate header file MagickWand.h 可是我明明正确安装了ImageMagick的呀.GOOGLE了半天,也解决不了这个问题.后面对照另一个服务器上的ImageMagick...

    php-5.6.29.tar.gz

    编译 ./configure --prefix=/usr/local/php --exec-prefix=/usr/local/php --bindir=/usr/local/php/bin --sbindir=/usr/local/php/sbin --includedir=/usr/local/php/include --libdir=/usr/local/php/lib/php --...

    rlwrap解决sqlplus 命令历史

    解决Oracle SQLPLUS没有命令历史的问题 tar zxf rlwrap-0.36.... ..../configure;make;make install echo "alias sqlplus='rlwrap sqlplus'">>~oracle/.bashrc echo "alias rman='rlwrap rman'">>~oracle/.bashrc

    CentOS7.2.1511 gcc4.8.5 通过编译的 tfs2.2.16

    /usr/bin/ld: cannot find -ljemalloc collect2: error: ld returned 1 exit statu 解决 curl -O http://www.canonware.com/download/jemalloc/jemalloc-4.0.4.tar.bz2 tar -jxvf jemalloc-4.0.4.tar.bz2 cd ...

    PHP编译configure时常见错误的总结

    PHP编译configure时常见错误的总结 PHP的安装虽然有时候很简单,可是如果应用一多,我们安装起来就很头痛了!...1、configure: error: No curses/termcap library found 网上有的说法是:–with-named-c

    libmount-2.25.2-实测版本

    经过实测的版本 configure: error: *** Could not find libmount checking for LIBMOUNT... no glib-2.56.0

    linux-ftpd-0.17安装包

    linux-ftpd安装 1、 tar xvzf linux-ftpd-0.17.tar.gz 2、vim configure ( prefix:一般安装到文件系统目录下的/usr/sbin中 ...root::0:0:root:/:/bin/sh ftp::14:50:FTP User:/var/ftp bin:*:1:1:bin:/bin

    gcc-4.9.4安装包

    在编译安装软件的时候,发现错误configure: error: *** A compiler with support for C++11 language features is required. 要支持C++11,必须升级到gcc4.7以上。

    gmp 5.0.4 安装GCC必需文件

    安装GCC必需的三个文件(gmp、mpfr、mpc)之一,gmp,安装此库之前需要先安装M4,否则无法完成安装。另:上述文件我已上传至我的资源,如有需要下载即可。 GMP is a free library for arbitrary precision ...

    centos7下升级openssh到8.4脚本

    centos7下升级openssh到8.4脚本

    php-7.3.7.tar.gz

    编译 ./configure --prefix=/usr/local/php --exec-prefix=/usr/local/php --bindir=/usr/local/php/bin --sbindir=/usr/local/php/sbin --includedir=/usr/local/php/include --libdir=/usr/local/php/lib/php --...

    openresty-1.13.6.2.tar.gz下载及openresty安装说明

    安装说明: OpenResty目标是让你的Web服务直接跑在 Nginx 服务内部,充分利用 Nginx 的非阻塞 I/O 模型,不仅仅对 HTTP 客户端请求,甚至于对远程后端诸如 MySQL、PostgreSQL、Memcached 以及 Redis 等都进行一致的高...

    device-mapper.1.02.28.tgz

    在编译parted-3.2时,报错:configure: error: libdevmapper could not be found,找到device-mapper.1.02.28,并下了下来。 这个源码藏得有点深,分享出来给大家

    php-7.2.20.tar.gz

    编译 ./configure --prefix=/usr/local/php --exec-prefix=/usr/local/php --bindir=/usr/local/php/bin --sbindir=/usr/local/php/sbin --includedir=/usr/local/php/include --libdir=/usr/local/php/lib/php --...

Global site tag (gtag.js) - Google Analytics