php解答:php怎么增加mysql扩展

 所属分类:php教程

 浏览:119次-  评论: 0次-  更新时间:2022-09-21
描述:更多教程资料进入php教程获得。 php增加mysql扩展的方法:1、通过yum安装libxml,openssl,mysql,mysql-devel等;2、修改“--with-mysql=/...
更多教程资料进入php教程获得。

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

千万级数据并发如何处理?进入学习

本文操作环境: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视频教程》

以上就是php怎么增加mysql扩展的详细内容,更多请关注zzsucai.com其它相关文章!

 标签: php,mysql扩展,
积分说明:注册即送10金币,每日签到可获得更多金币,成为VIP会员可免金币下载! 充值积分充值会员更多说明»

讨论这个素材(0)回答他人问题或分享使用心得奖励金币

〒_〒 居然一个评论都没有……

表情  文明上网,理性发言!