configure: error: Cannot find libmysqlclient under /usr/local/mysql.

执行下面语句:

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql  --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-gd
--enable-gd-native-ttf --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi
--enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear --with-libdir=lib64(警告)

报错:


checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
configure: error: Cannot find libmysqlclient under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!
[root@m php-5.5.25]# php -v
-bash: php: command not found

重新编译:

./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-mysql=/usr/local/mysql  --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-gd
--enable-gd-native-ttf --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi
--enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear        (去掉)--with-libdir=lib64参数

成功如下:

Generating files
configure: creating ./config.status
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

config.status: creating php5.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/fpm/php-fpm.conf
config.status: creating sapi/fpm/init.d.php-fpm
config.status: creating sapi/fpm/php-fpm.service
config.status: creating sapi/fpm/php-fpm.8
config.status: creating sapi/fpm/status.html
config.status: creating sapi/cgi/php-cgi.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: executing default commands
configure: WARNING: unrecognized options: --enable-discard-path, --enable-safe-mode, --with-curlwrappers, --enable-fastcgi, --enable-force-cgi-redirect
[root@m php-5.5.25]# 

编译成功有警告。

解决问题思路:

参考:

http://www.serveridol.com/2012/11/02/php-install-configure-error-cannot-find-libmysqlclient-under-usr/

PHP install – configure error : Cannot find libmysqlclient
under /usr.

I had to up-grade on MySQL server to 5.5 on last week in a server. Developers are accessing this server over the PhpMyAdmin url. This the server was configured with the php yum version which shipped with the OS. PhpMyAdmin was crashed once after I up-graded
the MySQL. It’s showing the following errors.

checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes
checking for specified location of the MySQL UNIX socket... no
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!

I see that MySQL package integrity has been lost after the up-gradation (I removed the default MySQL installs prior to this). Hence the ‘yum php’ will not work afterwards. So I’m planning to install PHP manually after remove all the php package using yum.
Download the source file from php.net and installing. When I execute “./configure” command returns mysql ibrary error.

Solution

You have to include “–with-libdir=lib64″ in config. parameters to get it work.

The following additional actions to be done for proper installation on 64 bit platform.

1. You might need to remove/rename the file Php-Apache library file “/usr/lib64/httpd/modules/libphp5.so” before executing “make install”
2. You may need to install MySQL libraries ie #yum install mysql-devel

3. Set php extension directory path in ‘/etc/php.ini’ to “/usr/lib64/php/modules”
extension_dir = “/usr/lib64/php/modules”

Then restart the web server to get it run. It’s the second time I got the same error even I remembered it had came earlier but I did not pick up the solution on time which is so sad…

-njoy -)

时间: 2024-09-17 04:34:57

configure: error: Cannot find libmysqlclient under /usr/local/mysql.的相关文章

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

今天在64位Red Hat Enterprise Linux AS release 4 .7上编译PHP5.2.6出错,mysql是使用的RPM方式安装的,PHP编译代码如下: ./configure --prefix=/usr/local/php --with-mysql --with-apxs2=/usr/local/apache/bin/apxs --with-openssl --with-curl --enable-xml --with-mcrypt --with-ttf --enabl

CentOS下启动apache报错,Syntax error on line 235 of /usr/local/apache2/conf/httpd.conf

问题描述 CentOS下启动apacheservice httpd startSyntax error on line 235 of /usr/local/apache2/conf/httpd.conf:Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: symbol deflate, version libmysqlclient_16 not

mysql起动报错The server quit without updating PID file /usr/local/mysql/data/

mysql起动报错The server quit without updating PID file (/usr/local/mysql/data/ 查看错误日志显示: mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql.pid ended 肯定是配置文件问题: 新安装的测试机  hostname server01  centos 6.5 环境   mysql 5.6.12 单机 64位 二进制包安装 my.cnf 里面只有一

ERROR 2002 (HY000): Cant connect to local MySQL server through socket的解决方法

连接MySQL提示ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)的解决方法 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 原文:http://www.aiezu.com/db/mysql_cant_connect_thro

解决The source directory "/usr/local" does not appear to contain CMakeLists.txt错误

风信网(ithov.com)原创文章:今天编译mysql-5.6.15-linux-glibc2.5-x86_64.tar.gz版本,决是报错,信息如下: [root@localhost mysql]# scripts/mysql_install_db --user=http://www.aliyun.com/zixun/aggregation/33.html">mysql --basedir=/usr/local/mysql --datadir=/data/mysql/data --fo

configure: error: Perl Module Time::HiRes not available错误解决方法

编译安装pnp4nagios-0.6.21的时候提示如下错误信息: checking for getloadavg... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking whether lstat dereferences a symlink specified with a trailing slash... yes checking whethe

configure: error: GD build test failed. Please check the config.log

Linux 源代码包配置PHP时出错:configure: error: GD build test failed. Please check the config.log Ps: 正确解答此问题者,追加200分!不够的还可以增加!谢谢啊! 无语啊...本来已经搭建好的源码环境,结果由于PHP版本太高,无法用Zend ZendOptimizer.我就把PHP5.6.4给卸载了,然后想装一个5.2.6的: 结果在配置时始终出错啊: 配置语句: # ./configure --prefix=/usr

centos-CentOS安装python2.7.9,竟然自己指向了/usr/local/bin,求原因

问题描述 CentOS安装python2.7.9,竟然自己指向了/usr/local/bin,求原因 在CentOS下安装python2.7.9,(下面会粘出操作history),本来以为按照网上说的,需要在/usr/bin下面改名字,做软链接什么的,发现竟然不用,请大神们解答这是一种什么机制. 命令行里输python,人家就是2.7.9版本了: [fy@VM_70_40_centos bin]$ python Python 2.7.9 (default, Mar 16 2016, 20:55:

php 不能连接数据库 php error Can't connect to local MySQL server_Mysql

测试的php文件 <?php $link=mysql_connect('localhost','root','zz') or die(mysql_error()); mysql_select_db('test') or die('no db'); mysql_query('SET NAMES utf8'); echo 99; ?> 运行后报错 Can't connect to local MySQL server through socket '/tmp/mysql.sock' 但在 命令行中