Hi All,
We are developing mongodb application and configured PHP and mongodb in AWS.
In my project , we are using mongodb version 3.2.4 in ubuntu 14.04 as Production server, mongodb version 2.4.9 in ubuntu 14.04 as other server,
And we configured PHP 5.5.9 and which contains php-mongodb version 1.4.5 and the OS is ubuntu 4.17;
In mongodb 2.4.9 server does not contain credentials. It can connect db through PHP .
But In mongodb 3.2.4 server have credentials and when I tried to connect Authentication failed message shows.
But actually client was able to connect the production server through android application using node js.
My sample code: test.php
sudo apt-get install
-f php-pear php5-dev ( here abort the connection)
sudo pecl install mongo
Best Regards
Sridhar N
On Fri, Sep 16, 2016 at 3:24 AM, Sridhar Naguru <sridhar...@gmail.com> wrote:
My sample code: test.php
$connection = new Mongo("mongodb://username:passwo...@api.abcdef.com:27017/mydb?authSource=admin");
Quick aside: the Mongo class has been deprecated since version 1.3.0. Please use MongoClient instead. The only difference is that MongoClient defaults to an acknowledged write concern, which is generally advised over the old default of unacknowledged writes.Do either your username or password include special characters (such as ":" or "@") or URI-encoded values (i.e. "%" followed by two numbers)? If so, you will need to specify them in the options array (second constructor argument). The legacy driver's URI parsing (defined here for version 1.4.5) is fairly primitive and does not handle URI-encoded values.The new driver ("mongodb" extension), which uses our C driver internally, does handle URI encoding.
If specifying the username and password in the array options still does not work, it may be helpful to collect MongoLog output from a failed case. This will generate quite a bit of output, so you'd want to share it as a paste or GitHub gist instead of copying the entire thing into a mailing list reply.
MongoLog::setCallback() has some example code that you can use to create some logs of internal driver activity (this includes URI parsing as well as network activity).
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CACypnJVJM_vptRR96wqByW0nB4OEb%2Brjm4yjvE-9oosMOHqtWA%40mail.gmail.com.
Hi,
I have updated php-mongo driver version 1.1.8 ( Ref: https://pecl.php.net/package/mongodb)
It needs to modify php.ini in /etc/php5/apache2/php.ini,
in php.ini file,need to add line as extension=mongodb.so
then need to restart the apache server.It should be affected and display the version in mongodb module in phpinfo page.
And I found in /etc/mongodb.conf , both are in comments.
#noauth = true
#auth = true
Here one should not be comment.(Need to remove #)
If I do like this , Will mongodb driver update properly?
Best Regards
Sridhar N
I am connecting AWS through Win SCP tool and tried some commands to update, but it was taken more than 1 hour and then abort the connection.
Cmds:
sudo apt-get install -f php-pear php5-dev ( here abort the connection)
sudo pecl install mongo
I have updated php-mongo driver version 1.1.8 ( Ref: https://pecl.php.net/package/mongodb)
It needs to modify php.ini in /etc/php5/apache2/php.ini,
in php.ini file,need to add line as extension=mongodb.so
then need to restart the apache server.It should be affected and display the version in mongodb module in phpinfo page.
And I found in /etc/mongodb.conf , both are in comments.
#noauth = true
#auth = true
Here one should not be comment.(Need to remove #)
If I do like this , Will mongodb driver update properly?