温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

php如何增加mysql扩展

发布时间:2021-12-14 10:05:50 来源:亿速云 阅读:223 作者:iii 栏目:编程语言

这篇文章主要讲解了“php如何增加mysql扩展”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“php如何增加mysql扩展”吧!

php增加mysql扩展的方法:1、通过yum安装libxml,openssl,mysql,mysql-devel等;2、修改“--with-mysql=/usr”即可。

php如何增加mysql扩展

本文操作环境:CentOS release 5.8系统,PHP5.6版,Dell G3电脑。

php怎么增加mysql扩展?

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

感谢各位的阅读,以上就是“php如何增加mysql扩展”的内容了,经过本文的学习后,相信大家对php如何增加mysql扩展这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI