解决Cannot find MySQL header files under /usr/include/mysql的错误

按照下面的步骤能成功,亲测。转帖,做笔记

编译php-5.5-6的mysql支持,出现Cannot find MySQL header files under /usr/include/mysql. Note that the MySQL client library is not bundled anymore!错误!解决方法如下:

[[email protected] php-5.5.6]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/include/mysql --with-mysqli=/usr/bin/mysql_config --with-iconv-dir --with-freetype-dir=/data/apps/libs --with-jpeg-dir=/data/apps/libs --with-png-dir=/data/apps/libs --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt=/data/apps/libs --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-opcache --with-pdo-mysql --enable-maintainer-zts

checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/time.h... (cached) yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking for stdarg.h... (cached) yes
checking size of int... (cached) 4
checking size of short... (cached) 2
checking size of long... (cached) 4
checking for an ANSI C-conforming const... yes
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 working memcmp... yes
checking for stdarg.h... (cached) yes
checking for mcrypt support... yes
checking for libmcrypt version... >= 2.5.6
checking for mcrypt_module_open in -lmcrypt... yes
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 MySQL header files under /usr/bin/mysql.
Note that the MySQL client library is not bundled anymore!
[[email protected] php-5.5.6]# find / -name mysql.h
/usr/include/mysql/mysql.h

查找到mysql.h文件,我们更改参数为--with-mysql=/usr,如果没有的话,请安装mysql-devel包,

[[email protected] php-5.5.6]# yum install mysql-devel

重新运行编译命令

[[email protected] php-5.5.6]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr --with-mysqli=/usr/bin/mysql_config --with-iconv-dir --with-freetype-dir=/data/apps/libs --with-jpeg-dir=/data/apps/libs --with-png-dir=/data/apps/libs --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt=/data/apps/libs --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-opcache --with-pdo-mysql --enable-maintainer-zts

编译过程省略
......
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

成功啦!编译通过啦!

时间: 2024-10-10 19:29:12

解决Cannot find MySQL header files under /usr/include/mysql的错误的相关文章

linux下安装php报错configure: error: Cannot find MySQL header files under /usr/include/mysql.

linux下安装php报错configure: error: Cannot find MySQL header files under /usr/include/mysql. 2013-03-04 15:34wdjhz | 分类:服务器软件 | 浏览5318次 configure: error: Cannot find MySQL header files under /usr/include/mysql.Note that the MySQL client library is not bun

编译安装php时提示Cannot find MySQL header files的解决方法

php的配置文件中有一行--with-mysql=/usr/local/mysql ,安装的时候提示:configure: error: Cannot find MySQL header files under yes.Note that the MySQL client library is not bundled anymore. 这是由于安装mysql时没有安装mysql头文件,或者是路径指定不正确,php找不到mysql的头文件引起的错误提示. 解决方法.1. 查看你的系统有没有安装my

解决mysql跟php不在同一台机器上,编译安装php服务报错问题:configure: error: Cannot find MySQL header files under /application/mysql.

在编译安装php服务时报错: configure: error: Cannot find MySQL header files under /application/mysql. Note that the MySQL client library is not bundled anymore! 前边搭建lnmp环境时,是把mysql和php安装在了同一台机器上,编译php的时候,需要通过参数 --with-mysql来指定mysql的安装路径,但在生产环境中,通常php和mysql是不在同一台

解决:error: Cannot find libmysqlclient_r under /usr/local/mysql.

转 解决:error: Cannot find libmysqlclient_r under /usr/local/mysql. 配置php的时候出现以下问题解决方案 checking for MySQL support... yeschecking for specified location of the MySQL UNIX socket...nochecking for MySQL UNIX socket location... noconfigure: error: Cannot fi

启动 mysql 失败 Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql'

Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' 这应该是某种情况下导致/usr/local/mysql/data的宿主发生了改变. 解决方法:打开终端运行 sudo chown -R mysql /usr/local/mysql/data 即可. mac 下运行  sudo chown -R  _mysql:wheel  /usr/local/mysql/data . -c 显

mysql 初始化报错 /usr/local/mysql/bin/mysqld:error while loading shared libraries :libaio.so.1

安装mysql在初始化的时候,出现/usr/local/mysql/bin/mysqld:error while loading shared libraries:libaio.so.1 :cannot open shared object file:NO such file or directory 解决方法: <P>type the following</P> <P>apt-get install libaio1 libaio-dev</P> <P

MySQL启动时必需到usr/local/mysql目录的问题解决方法

之前我安装MySql数据库的时候,由于我的MySQL不是安装在标准的/usr/local/mysql目录,而是安装在/usr/local/development/mysql-5.5.25目录,导致在启动MySQL服务时报告找不到/usr/local/mysql目录的错误.最后我就创建了符号链/usr/local/mysql链接到/usr/local/development/mysql-5.5.25,解决了服务启动不了的问题. 为什么会出现此问题呢?我们可以打开mysql.server脚本文件,里

Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid).

? [[email protected] ~]# cd /usr/local/mysql ? [[email protected] mysql]# chown -R mysql.mysql . [[email protected] mysql]# su - mysql [[email protected] ~]$ cd /usr/local/mysql [[email protected] mysql]$ scripts/mysql_install_db ??

MySQL数据库“十宗罪”(十大经典错误案例)

Top  1: Too many connections(连接数过多,导致连接不上数据库,业务无法正常进行) 问题还原 1 2 3 4 5 6 mysql> show variables like '%max_connection%'; | Variable_name   | Value | max_connections | 151   |  mysql> set global max_connections=1;Query OK, 0 rows affected (0.00 sec) [[