PHP增加MysqL扩展的方法:1、通过yum安装libxml,openssl,MysqL,MysqL-devel等;2、修改“--with-MysqL=/usr”即可。
本文操作环境:CentOS release 5.8系统,PHP5.6版,Dell G3电脑。
os:CentOS release 5.8 (Final)
PHP 版本:http://cn2.PHP.net/distributions/PHP-5.6.18.tar.gz
先yum安装libxml ,openssl ,MysqL,MysqL-devel 等。
./configure --prefix=/usr/local/PHP5 --with-config-file-path=/usr --with-MysqL=/usr/include/MysqL --with-MysqLi=/usr/bin/MysqL_config --with-libxml-dir=/usr/local/libxml2 --with-openssl
报错:
Cannot find MysqL header files under /usr/include/MysqL
网上各种说法都尝试了,都没有用,后来我直接看configure文件为啥老这样报,
于是先grep 'error: Cannot find MysqL header files under' configure -n
发现出现这条日志的地方在这里:
./configure: fi if test $PHP_MysqL = yes || test $PHP_MysqL = MysqLnd; then PHP_MysqLND_ENABLED=yes elif test $PHP_MysqL != no; then MysqL_DIR= MysqL_INC_DIR= if test -r $PHP_MysqL/include/MysqL/MysqL.h; then MysqL_DIR=$PHP_MysqL MysqL_INC_DIR=$PHP_MysqL/include/MysqL break elif test -r $PHP_MysqL/include/MysqL.h; then MysqL_DIR=$PHP_MysqL MysqL_INC_DIR=$PHP_MysqL/include break fi if test -z $MysqL_DIR; then { { $as_echo $as_me:$LINENO: error: test Cannot find MysqL header files under $PHP_MysqL. Note that the MysqL client library is not bundled anymore! >&5 $as_echo $as_me: error: hgyang Cannot find MysqL header files under $PHP_MysqL $MysqL_DIR. Note that the MysqL client library is not bundled anymore! >&2;} { (exit 1); exit 1; }; } fi
你妹啊!!!
原来 --with-MysqL=/usr就可以了,include/MysqL已经被包含了,哥瞬间泪奔了,好大一个坑。
推荐学习:《PHP教程》
原文地址:https://www.jb51.cc/php/2916578.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。