配置php --with-mysql,这时mysql需要打开吗?
配置php --with-mysql,这时mysql需要打开吗?
# which mysql
/usr/bin/mysql
./configure --prefix=/usr/local/php \
--with-mysql=/usr/bin/mysql \
--with-zlib-dir=/usr \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-libxml-dir=/usr/local/libxml2
报错
configure: error: Cannot find MySQL header files under /usr/bin/mysql.
Note that the MySQL client library is not bundled anymore!
# find / | grep mysql.h
/usr/include/mysql/mysql.h
--with-mysql=这里是要写目录还是写mysql可执行文件的绝对路径?
--with-mysql=/usr/include/mysql/ 不需要,mysql和mysql-dev是两个包,有了mysql,数据库就可以服务了,mysql-dev是开发的一些头文件和库文件。没有就下载安装一下就好了 bikong0411 发表于 2013-07-17 08:37 static/image/common/back.gif
--with-mysql=/usr/include/mysql/
configure: error: Cannot find MySQL header files under /usr/include/mysql
应该指定的是mysql的安装路径,
我这是安装系统的时候把mysql作为组件安装上去的,--这样的安装的话,mysql的安装路径或者说,安装目录是那个呢?
/uer/bin和mysql相关的文件只有mysql
/usr/include目录下和mysql相关的文件恐怕只有mysql.h
可见,这两个目录并非mysql的安装目录?? configure: error: Cannot find MySQL header files under /usr/include/mysql.
Note that the MySQL client library is not bundled anymore!
# ls /usr/include/mysql/mysql.h
/usr/include/mysql/mysql.h
明明就是有啊,configure怎么说找不到? 回复 5# XQKA
如果是编译安装的话就好办多了 php5.3之后编译安装就不需要指定msyql安装路径了。编译时指定以下参数即可:
--with-mysql=mysqlnd--with-pdo-mysql=mysqlnd --with-pdo-mysql=mysqlnd
参考资料:http://baike.baidu.com/view/2630684.htm
页:
[1]