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

时间:2023-03-08 18:06:39

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. 查看你的系统有没有安装mysql header
find / -name mysql.h
如果有。请指定--with-mysql=/跟你的正常路径。
如果没有这个头文件,或者已经指定了正确路径依然报错。请看下一步。

2.redhat安装
#yum install -y mysql-devel