新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
php怎么增加mysql擴展
本文操作環(huán)境:centos release 5.8系統(tǒng),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 等。
網(wǎng)上搜索了下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
網(wǎng)上各種說法都嘗試了,都沒有用,后來我直接看configure文件為啥老這樣報,
于是先grep 'error: Cannot find MySQL header files under' configure -n
發(fā)現(xiàn)出現(xià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
你妹?。。。?/p>
原來 --with-mysql=/usr就可以了,include/mysql已經(jīng)被包含了,哥瞬間淚奔了,好大一個坑。
分享標題:php怎么增加mysql擴展
新聞來源:http://www.dlmjj.cn/article/djhsshj.html


咨詢
建站咨詢
