四虎影视在线影院在线观看,小s货再浪些再咬紧点h,国产精品水嫩水嫩,97精产国品一二三产区

Board logo

標(biāo)題: [教程] 增加mysqli 擴(kuò)展 的安裝 [打印本頁(yè)]

作者: bluegua    時(shí)間: 2011-11-15 17:13     標(biāo)題: 增加mysqli 擴(kuò)展 的安裝

假如你是用lanmp.tar.gz安裝的
cd lanmp/php-5.2.17
可以通過(guò)phpinfo來(lái)查看原本php的編譯參數(shù),如下
./configure --prefix=/www/wdlinux/php-5.2.17 --with-config-file-path=/www/wdlinux/etc --with-fpm-conf=/www/wdlinux/etc/php-fpm.conf --with-mysql=/www/wdlinux/mysql --with-iconv-dir=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-ftp --with-apxs2=/www/wdlinux/apache/bin/apxs

在最后增加 --with-mysqli=/www/wdlinux/mysql/bin/mysql_config

全部如下
./configure --prefix=/www/wdlinux/php-5.2.17 --with-config-file-path=/www/wdlinux/etc --with-fpm-conf=/www/wdlinux/etc/php-fpm.conf --with-mysql=/www/wdlinux/mysql --with-iconv-dir=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-ftp --with-apxs2=/www/wdlinux/apache/bin/apxs --with-mysqli=/www/wdlinux/mysql/bin/mysql_config
然后
make;make install

編譯完,重起下httpd就可以了,如
service httpd restart

完成
以上是對(duì)apache的,如果是nginx,方法一樣,只是把a(bǔ)pache相關(guān)的替換為nginx即可

也單獨(dú)下載php-5.2.17.tar.gz文件進(jìn)行編譯
作者: hyxuzhimin    時(shí)間: 2012-1-16 14:08

本帖最后由 hyxuzhimin 于 2012-1-16 14:32 編輯

我需要裝pdo_mysql.so 擴(kuò)展是不是也重新編譯這么裝?
--with_pdo_mysql  ??
這是我lanmp.sh文件里找到的
325:    ./configure --prefix=$IN_DIR/php-5.2.17 --with-config-file-path=$IN_DIR/etc --with-mysql=$IN_DIR/mysql --with-iconv=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-ftp $NV
請(qǐng)問(wèn)是在這里添加--with_pdo_mysql  來(lái)安裝pdo_mysql.so 擴(kuò)展嗎?
作者: hyxuzhimin    時(shí)間: 2012-1-16 18:13

請(qǐng)問(wèn)為什么我添加之后 configure,提示
configure: error: --with_pdo_mysql: invalid option; use --help to show usage
作者: admin    時(shí)間: 2012-1-16 20:59

參數(shù)錯(cuò)誤,應(yīng)該是--with-pdo-mysql
作者: share    時(shí)間: 2012-1-19 12:59

為什么編譯完后phpinfo()函數(shù)不能用了呢?
作者: hyxuzhimin    時(shí)間: 2012-1-25 21:01

本帖最后由 hyxuzhimin 于 2012-1-25 21:03 編輯

回復(fù) 4# admin
很奇怪 只加--with-pdo-mysql然后configure會(huì)提示找不到mysql的header。有--with-mysql=/www/wdlinux/mysql-5.1.56 也不行。而mysql.h在這個(gè)路徑里。
但是改成 --with-pdo-mysql=/www/wdlinux/mysql-5.1.56/bin/mysql_config    , configure就成功了。
作者: hyxuzhimin    時(shí)間: 2012-1-25 21:05

改成這樣就成功了。
./configure --prefix=/www/wdlinux/php-5.2.17 --with-config-file-path=/www/wdlinux/etc  --with-mysql=/www/wdlinux/mysql-5.1.56  --with-pdo-mysql=/www/wdlinux/mysql-5.1.56/bin/mysql_config  --with-iconv=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-ftp
作者: hyxuzhimin    時(shí)間: 2012-1-25 21:52

很奇怪用上面的configure參數(shù)可以make make install,但phpinfo()里依然沒(méi)有pdo-mysql,而且參數(shù)里也沒(méi)--with-pdo-mysql=/www/wdlinux/mysql-5.1.56/bin/mysql_config
pdo.jpg
configure.jpg

圖片附件: pdo.jpg (2012-1-25 21:52, 31.21 KB) / 下載次數(shù) 15323
http://cd-genova.com/bbs/attachment.php?aid=228&k=3cff355d44803b95cba3b8ed8bd5eec3&t=1743757851&sid=WhGi6M



圖片附件: configure.jpg (2012-1-25 21:52, 46.29 KB) / 下載次數(shù) 15336
http://cd-genova.com/bbs/attachment.php?aid=229&k=3e462d234336eda428520cbcd8209c52&t=1743757851&sid=WhGi6M


作者: hyxuzhimin    時(shí)間: 2012-1-26 01:08

請(qǐng)問(wèn)單獨(dú)編譯pdo_mysql為啥也不行?
我是通過(guò)這個(gè)教程裝的 http://www.cnblogs.com/DavidYan/articles/2149647.html
使用了lanmp壓縮包里的PDO_MYSQL-1.0.2.tgz
tar xzf  PDO_MYSQL-1.0.2.tgz
cd  PDO_MYSQL-1.0.2
/www/wdlinux/php-5.2.17/bin/phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
./configure --with-php-config=/www/wdlinux/php-5.2.17/bin/php-config --with-pdo-mysql=/www/wdlinux/mysql
順利安裝,并修改了vi /www/wdlinux/etc/php.ini
extension=pdo_mysql.so
我find一下pdo_mysql.so已經(jīng)放在php/extensions/debug-non-zts-20060613/pdo_mysql.so文件夾了
重啟httpd
但是phpinfo里還是沒(méi)有pdo_mysql,Drupal安裝也沒(méi)有找到mysql,只有sqlite.
請(qǐng)問(wèn)這是怎么回事呢?
作者: hyxuzhimin    時(shí)間: 2012-1-26 01:12

./configure --prefix=/www/wdlinux/php-5.2.17 --with-config-file-path=/www/wdlinux/etc  --with-mysql=/www/wdlinux/mysql  --enable-pdo  --with-pdo-mysql=/www/wdlinux/mysql  --with-iconv=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-ftp 重新改了參數(shù)make install 成功還是不能在phpinfo里看到pdo_mysql,drupal7也找不到mysql,只有sqlite。求助大蝦了。因?yàn)樯厦鎯煞N安裝現(xiàn)在都順利了,但是還是開(kāi)啟不了pdo_mysql
作者: admin    時(shí)間: 2012-1-26 11:38

重起一下apache
作者: hamen    時(shí)間: 2012-1-26 17:03

/tmp/lanmp/php-5.2.17/ext/standard/info.c:68: undefined reference to `ts_resource_ex'
ext/standard/.libs/info.o: In function `php_print_info':
/tmp/lanmp/php-5.2.17/ext/standard/info.c:743: undefined reference to `executor_globals_id'
/tmp/lanmp/php-5.2.17/ext/standard/info.c:746: undefined reference to `executor_globals_id'
/tmp/lanmp/php-5.2.17/ext/standard/info.c:749: undefined reference to `executor_globals_id'
/tmp/lanmp/php-5.2.17/ext/standard/info.c:752: undefined reference to `executor_globals_id'
/tmp/lanmp/php-5.2.17/ext/standard/info.c:676: undefined reference to `sapi_globals_id'
/tmp/lanmp/php-5.2.17/ext/standard/info.c:469: undefined reference to `sapi_globals_id'
/tmp/lanmp/php-5.2.17/ext/standard/info.c:655: undefined reference to `sapi_globals_id'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
增加mysql擴(kuò)展的時(shí)候出現(xiàn)錯(cuò)誤,麻煩看看。
作者: hamen    時(shí)間: 2012-1-26 18:40

假如你是用lanmp.tar.gz安裝的
cd lanmp/php-5.2.17
可以通過(guò)phpinfo來(lái)查看原本php的編譯參數(shù),如下
./c ...
bluegua 發(fā)表于 2011-11-15 17:13



    按照這么做后,查看phpinfo文件信息,
Command './configure' '--prefix=/www/wdlinux/php-5.2.17' '--with-config-file-path=/www/wdlinux/etc' '--with-mysql=/www/wdlinux/mysql' '--with-iconv=/usr' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-discard-path' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-ftp' '--with-apxs2=/www/wdlinux/apache/bin/apxs'


Command './configure' '--prefix=/www/wdlinux/php-5.2.17' '--with-config-file-path=/www/wdlinux/etc' '--with-mysql=/www/wdlinux/mysql' '--with-iconv=/usr' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-discard-path' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-ftp' '--with-apxs2=/www/wdlinux/apache/bin/apxs'
./configure' '--prefix=/www/wdlinux/php-5.2.17' '--with-config-file-path=/www/wdlinux/etc' '--with-mysql=/www/wdlinux/mysql' '--with-iconv=/usr' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-discard-path' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-ftp' '--with-apxs2=/www/wdlinux/apache/bin/apxs'

還是這樣,沒(méi)看見(jiàn)加載mysqli
作者: admin    時(shí)間: 2012-1-26 20:40

沒(méi)有mysqli的的參數(shù)
作者: hamen    時(shí)間: 2012-1-26 20:57

什么意思,我用configure 添加了啊,在哪里設(shè)置mysqli參數(shù)。
作者: hamen    時(shí)間: 2012-1-26 21:50

make出錯(cuò):

ext/iconv/iconv.o: In function `_php_iconv_strlen':
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:603: undefined reference to `libiconv_open'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:626: undefined reference to `libiconv'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:660: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `php_iconv_string':
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:441: undefined reference to `libiconv_open'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:453: undefined reference to `libiconv'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:467: undefined reference to `libiconv'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:478: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_strpos':
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:851: undefined reference to `libiconv_open'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:879: undefined reference to `libiconv'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:993: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_appendl':
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:348: undefined reference to `libiconv'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:385: undefined reference to `libiconv'
ext/iconv/iconv.o: In function `_php_iconv_substr':
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:723: undefined reference to `libiconv_open'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:747: undefined reference to `libiconv'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:802: undefined reference to `libiconv_close'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:806: undefined reference to `libiconv_close'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:755: undefined reference to `libiconv_open'
ext/iconv/iconv.o: In function `_php_iconv_mime_decode':
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1354: undefined reference to `libiconv_open'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1465: undefined reference to `libiconv_close'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1468: undefined reference to `libiconv_open'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1823: undefined reference to `libiconv_close'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1826: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `php_iconv_stream_filter_dtor':
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:2465: undefined reference to `libiconv_close'
ext/iconv/iconv.o: In function `_php_iconv_mime_encode':
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1043: undefined reference to `libiconv_open'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1057: undefined reference to `libiconv_open'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1316: undefined reference to `libiconv_close'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1319: undefined reference to `libiconv_close'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1176: undefined reference to `libiconv'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1128: undefined reference to `libiconv'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1160: undefined reference to `libiconv'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1319: undefined reference to `libiconv_close'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1228: undefined reference to `libiconv'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1259: undefined reference to `libiconv'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:1303: undefined reference to `libiconv'
ext/iconv/iconv.o: In function `php_iconv_stream_filter_append_bucket':
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:2615: undefined reference to `libiconv'
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:2537: undefined reference to `libiconv'
ext/iconv/iconv.o: In function `php_iconv_stream_filter_ctor':
/tmp/lanmp/php-5.2.17/ext/iconv/iconv.c:2491: undefined reference to `libiconv_open'
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1
作者: hyxuzhimin    時(shí)間: 2012-1-27 01:54

回復(fù) 11# admin
重啟過(guò)apache,機(jī)器也重啟過(guò)。pdo-mysql還是沒(méi)安裝成功。
作者: hyxuzhimin    時(shí)間: 2012-1-27 23:38

回復(fù) 11# admin
經(jīng)自己編譯的lamp(centos5.7+最新amp版本)測(cè)試可以加入pdo-mysql,并安裝drupal成功。
但是cent5.6Base+lamnp的。死活不能加入pdo-mysql。請(qǐng)檢查下。謝謝。
作者: admin    時(shí)間: 2012-1-28 09:32

都一樣的,lanmp也是編譯
留意下錯(cuò)誤提示或檢查下參數(shù)
作者: hyxuzhimin    時(shí)間: 2012-1-28 21:33

本帖最后由 hyxuzhimin 于 2012-1-28 21:39 編輯

回復(fù) 19# admin
./configure --prefix=/www/wdlinux/php-5.2.17 --with-config-file-path=/www/wdlinux/etc  --with-mysql=/www/wdlinux/mysql  --enable-pdo  --with-pdo-mysql=/www/wdlinux/mysql  --with-iconv=/usr --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt=/usr --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-ftp
你好。我試過(guò)好多遍了,參數(shù)是上面的,編譯過(guò)程中沒(méi)提示錯(cuò)誤,我在非wdlinux版的centos5.7下編譯安裝可以成。不知道是不是系統(tǒng)的原因。還是apahce和nginx一起的原因。搞不清啊。
作者: wpailili    時(shí)間: 2012-5-30 19:49

回復(fù) 20# hyxuzhimin


    要怎么編譯啊   我是CentOS 6.0   
跪求解釋啊




歡迎光臨 WDlinux官方論壇 (http://cd-genova.com/bbs/) Powered by Discuz! 7.2