0

I have a PHP script which on Server A, process Mongo commands with no problem, on Server B, the same line of codegive me an error

The MongoCursor object has not been correctly initialized by its constructor

I suppose the problem is some Server configuration, as I have only FTP access to both servers, my questions:

  • Using phpinfo on Server A I cannot see asection dedicated to Mongo, how do I see if Mongo driver are up and running?
  • Could you provide me more information about this specif error?
GibboK
  • 71,848
  • 143
  • 435
  • 658
  • This is a coding error not server config or anything, can you show us some code? – Sammaye Apr 15 '13 at 07:23
  • To elaborate, this error rises when you have incorrectly called the constructor for the MongoCursor from within PHP and as such the MongoCursort object is not correctly initialized by its constructor, this error threw me at first too before I realised I had to fix syntax errors. As for the phpinfo part, I am unsure why you cannot find a `mongo` part there – Sammaye Apr 15 '13 at 08:09

1 Answers1

1

Refer this for mongo exception errors:-

http://php.net/manual/en/class.mongoexception.php
chandresh_cool
  • 11,753
  • 3
  • 30
  • 45
  • Thanks for your link, unfortunately I do not understand what it means, could be a problem with Server configuration? – GibboK Apr 15 '13 at 07:25
  • Try printing your mongo connection parameters does it sho u connected? Then configuration should not be an issue or else it must be. – chandresh_cool Apr 15 '13 at 07:27
  • My code work on one Server and same code to another server give me an error. Any ideas? – GibboK Apr 15 '13 at 07:31
  • try this links http://stackoverflow.com/questions/5091624/is-mongodb-running http://stackoverflow.com/questions/11134959/check-if-mongodb-php-driver-is-installed – chandresh_cool Apr 15 '13 at 07:32