php 添加mysql扩展

os:CentOS release 5.8 (Final)
php 版本:http://cn2.php.net/distributions/php-5.6.18.tar.gz

先yum安装libxml ,openssl ,mysql,mysql-devel 等。

网上搜索了下congfigure命令如下

./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已经被包含了,哥瞬间泪奔了,好大一个坑。

 

转载于:https://my.oschina.net/u/346938/blog/624722

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值