Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. try
  4. {
  5. $conn = new Mongo('10.147.87.92');
  6. $username = "admin";
  7. $password = "php";
  8. $db = $conn->user;
  9. $db->authenticate($username,$password);
  10. }
  11. catch (MongoConnectionException $e)
  12. {
  13. die('Error connecting to MongoDB server');
  14. }
  15. catch (MongoException $e)
  16. {
  17. die('Error: ' . $e->getMessage());
  18. }
  19. ?>
  20.  
  21. # problem is it is successfully connecting to localhost but not to 10.147.87.92 ...any help
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement