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

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介: <p><br></p> <p><span style="color:#3333ff">执行下面语句:</span></p> <p>./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql  --with-mysqli=/usr/


执行下面语句:

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



相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
4月前
|
关系型数据库 MySQL
MySQL 报错 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file
MySQL 报错 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file
306 0
|
3月前
|
关系型数据库 MySQL
ERROR 1449 (HY000): The user specified as a definer (‘mysql.infoschema‘@‘localhost‘) does not exist
ERROR 1449 (HY000): The user specified as a definer (‘mysql.infoschema‘@‘localhost‘) does not exist
21 0
|
3月前
|
SQL 数据采集 关系型数据库
如何解决MySQL报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL?
如何解决MySQL报错 You have an error in your SQL syntax; check the manual that corresponds to your MySQL?
|
19天前
|
关系型数据库 MySQL 数据安全/隐私保护
MySQL连接ERROR 2059 (HY000): Authentication plugin ‘caching_sha2_password‘ cannot be loaded
MySQL连接ERROR 2059 (HY000): Authentication plugin ‘caching_sha2_password‘ cannot be loaded
25 0
|
4月前
|
SQL 关系型数据库 MySQL
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
27 0
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
|
5月前
|
关系型数据库 MySQL
mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such
mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such
|
5月前
|
SQL 关系型数据库 MySQL
Could not execute query ---> MySql.Data.MySqlClient.MySqlException: You have an error in your SQL sy
Could not execute query ---> MySql.Data.MySqlClient.MySqlException: You have an error in your SQL sy
20 0
|
12天前
|
关系型数据库 MySQL 数据库
mysql卸载、下载、安装(window版本)
mysql卸载、下载、安装(window版本)
|
30天前
|
关系型数据库 MySQL 数据库
rds安装数据库客户端工具
安装阿里云RDS的数据库客户端涉及在本地安装对应类型(如MySQL、PostgreSQL)的客户端工具。对于MySQL,可选择MySQL Command-Line Client或图形化工具如Navicat,安装后输入RDS实例的连接参数进行连接。对于PostgreSQL,可以使用`psql`命令行工具或图形化客户端如PgAdmin。首先从阿里云控制台获取连接信息,然后按照官方文档安装客户端,最后配置客户端连接以确保遵循安全指引。
82 1
|
25天前
|
Ubuntu 关系型数据库 MySQL
Ubuntu 中apt 安装MySQL数据库
Ubuntu 中apt 安装MySQL数据库
66 0