`
cocos
  • 浏览: 400380 次
  • 性别: 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 

 

分享到:
评论

相关推荐

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

    总的来说,当遇到“configure error Cannot find libmysqlclient under /usr”这类错误时,关键在于找到库的实际位置并更新或创建链接,以及确保所有依赖项已正确安装。如果涉及特定扩展,例如mysqli,可能还需要...

    CentOS下编译php时的一些典型错误及解决办法.

    11. configure: error: Cannot find MySQL header files under /usr.Note that the MySQL client library is not bundled anymore! 解决方法: yum install mysql-devel 此错误是由于缺少 mysql-devel 库文件所...

    安装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/...

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

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

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

    3. **错误:configure: error: Cannot find OpenSSL’s** 解决方案:在CentOS上,需安装`openssl-devel`,命令为`yum -y install openssl-devel`。 4. **错误:configure: error: libjpeg.(a|so) not found** ...

    Linphone编译错误及解决方法

    7. configure: error: Could not find libavcodec (from ffmpeg) headers and library. This is mandatory for video support 错误原因:缺少libavcodec头文件和库文件。 解决方法:sudo apt-get install ...

    Arm板Apache+PHP环境搭建

    configure: error: cannot check for file existence when cross compiling的错误。 2. 需要添加ac_cv_func_setpgrp_void=yes选项,以避免出现checking whether setpgrp takes no argument... configure: error: ...

    apache2.4完整安装

    ### Apache2.4完整安装及解决configure: error: APR-util not found问题 #### 一、背景介绍 Apache HTTP Server(通常简称为Apache)是目前最流行的Web服务器软件之一,广泛应用于互联网上的各种网站和应用程序。...

    libmount-2.32.tar.gz

    然而,当我们尝试编译和安装这个版本时,可能会遇到“configure: error: *** Could not find libmount”这样的错误提示,这通常是由于系统环境配置不完整或者依赖关系未满足所导致的。 首先,我们要明白“configure...

    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源代码安装常见错误与解决办法分享

    16. **错误:Configure: error: Cannot find MySQL header files under /usr. Note that the MySQL client library is not bundled anymore!** 解决:再次确认是否已安装`mysql-devel`,如果没有,运行`yum install...

    gmp 5.0.4 安装GCC必需文件

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

    Linux 下 Nginx的安装:(解压,进入目录里面执行,./configure –-> make -> sudo make install)

    在标题中提到的配置中,`--prefix`用于设置Nginx的安装路径,默认为`/usr/local/nginx`。你可以根据需要添加其他配置参数。例如: ```bash ./configure --prefix=/usr/local/nginx --with-...

    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 --...

    gcc-4.9.4安装包

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

    device-mapper.1.02.28.tgz

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

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

    第一个错误是`configure: error: Cannot find ldap libraries in /usr/lib`。这个错误发生在配置阶段,表示PHP的configure脚本无法找到ldap库。在64位的Linux系统中,库文件通常被放置在 `/usr/lib64` 目录下,而...

    php yar扩展

    例如,如果你知道你的PHP安装在`/usr/local/php`,则可以使用: ``` ./configure --with-php-config=/usr/local/php/bin/php-config ``` 3. 编译源码: ``` make ``` 4. 安装扩展到PHP的扩展目录: ``` ...

    Linux 开发板移植gdb

    开发板没有gdb,写程序老出错而且找不到问题在哪里。于是痛定思痛,决定移植一个gdb。 交叉编译器:arm-none-linux-gnueabi ...(3)./configure –host=arm-none-linux-gnueabi –prefix=$PWD/install –wi

Global site tag (gtag.js) - Google Analytics