php怎么增加mysql扩展

发布时间:2024-04-27 点击:76
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:fiif test \”$php_mysql\” = \”yes\” || test \”$php_mysql\” = \”mysqlnd\”; then php_mysqlnd_enabled=yeselif 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视频教程》

怎么购买网站域名教程?如何选择域名后缀?
如何自己建立一个网站?建立一个网站需要学习什么?
企业网站建设一条龙包括哪些内容?
一个普通的域名多少钱一个
电脑版微信怎么截图?设置微信电脑版截图快捷键的方法
域名如何解析?域名解析怎么设置?
国外域名转移到国内怎么做?国外域名可以转移到国内吗?
域名续费价格表是怎样的 在哪里进行域名续费