Mongodb connection in PHP not working(PHP中的Mongodb连接不起作用)
问题描述
我正在使用 Ubuntu 12.04 LTS 并在 /opt/lampp/bin/
中安装了 pecl.
I am using Ubuntu 12.04 LTS and installed pecl in /opt/lampp/bin/
.
第二次安装时抛出错误-
When installing second time its throwing error -
之前运行的命令 -
pecl install mongo
pecl/mongo 已经安装,和发布的一样1.5.1版安装失败
pecl/mongo is already installed and is the same as the released version 1.5.1 install failed
现在当我检查时 -
echo extension_loaded("mongo") ?"已加载
" : "未加载
";
echo extension_loaded("mongo") ? "loaded
" : "not loaded
";
显示未加载.
但是我用 extension=mongo.so
更新了 php.ini 并重新启动了服务器,但它不起作用.
However I updated the php.ini with extension=mongo.so
and restarted the server, but its not working.
现在让我看看我做错了什么.
Let me now what I am doing wrong.
编辑
我重新实例化了命令,结果如下-
I re instantiated the command and following is the outcome -
Build process completed successfully
Installing '/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/mongo.so'
install ok: channel://pecl.php.net/mongo-1.5.1
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongo.so" to php.ini
推荐答案
终于在Neil Lunn的帮助下我做对了.
Finally with the help of Neil Lunn I made it the right way.
我添加了完整路径,并在我的 php.ini
I added the full path and added the code at the very last line of my php.ini
extension="/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/mongo.so"
extension="/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/mongo.so"
这篇关于PHP中的Mongodb连接不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP中的Mongodb连接不起作用


基础教程推荐
- 超薄框架REST服务两次获得输出 2022-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- 在多维数组中查找最大值 2021-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01