現在我已經通過我的Ubuntu PC上的apt-get安裝了php 5.3。*,但是我需要使用5.4.5來解決某些問題。 根據這個原因,我嘗試編譯和蒙戈驅動程序安裝新版本的PHP 5.4.5到separete地方: 我做下面的步驟:使用mongo驅動程序編譯php 5.4.5
sudo su
cd /opt
tar xfz php-5.4.5.tar.gz
cd php-5.4.5
./configure --prefix=/opt/php545 --enable-phar --with-config-file-path=/opt/php545/php.ini
make & make install
上面的命令後,我取得了工作的PHP:
/opt/php545/bin/php -v
PHP 5.4.5 (cli) (built: Aug 15 2012 09:04:56)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
後,我做了下一個:
/opt/php545/bin/pecl install mongo
,並返回我
Build process completed successfully
Installing '/opt/php545/lib/php/extensions/no-debug-non-zts-20100525/mongo.so'
install ok: channel://pecl.php.net/mongo-1.2.12
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongo.so" to php.ini
我加入/opt/php545/php.ini下一行
extension=/opt/php545/lib/php/extensions/no-debug-non-zts-20100525/mongo.so
但蒙戈不加載模塊:
/opt/php545/bin/php -m | grep mongo
!!!Nothing here!!!
我做了什麼錯?
PS:
/opt/php545/bin/php -i | grep php.ini
回報
Configuration File (php.ini) Path => /opt/php545/php.ini
(php.ini中塞汀正確)
如果只是'extension = mongo.so',結果如何? – xdazz 2012-08-15 08:18:28