新聞中心
這篇文章主要講解了“php如何增加MySQL擴展”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“php如何增加mysql擴展”吧!
創(chuàng)新互聯(lián)公司主要從事成都網站設計、成都做網站、網頁設計、企業(yè)做網站、公司建網站等業(yè)務。立足成都服務武城,10余年網站建設經驗,價格優(yōu)惠、服務專業(yè),歡迎來電咨詢建站服務:18980820575
php增加mysql擴展的方法:1、通過yum安裝libxml,openssl,mysql,mysql-devel等;2、修改“--with-mysql=/usr”即可。
本文操作環(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 等。
網上搜索了下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
發(fā)現出現這條日志的地方在這里:
./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擴展這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關知識點的文章,歡迎關注!
當前名稱:php如何增加mysql擴展
瀏覽路徑:http://www.ef60e0e.cn/article/ijepjd.html