Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
New PHP driver 1.2.3 not compatible to MongoDB 3.4 on laravel 4.2

We are using following software in our web app Like...

  1. Laravel 4.2 (PHP framework)
  2. MongoDB(3.4)
  3. PHP Version 5.6 (Ubuntu 14 LTS)

    So after updated MongoDB version from 2.6 to 3.4 some API closed.(Coordinate search)

    So we found need to upgrade php driver from mongodb site ! (Reference link : http://php.net/manual/en/mongodb.installation.php)

    -Necessary changes made in following file

    -php.ini (/etc/php5/cli/php.ini) -phpini (/etc/php5/apache2/php.ini) -mongo.ini (/etc/php5/mods-available/mongo.ini)

    Changes are in only one line this: extension=mongo.so TO extension=mongodb.so

    But following error still coming.. [Mon Jan 23 16:38:58.714244 2017] [:error] [pid 5612] [client 127.0.0.1:60816] PHP Fatal error: Uncaught exception 'ReflectionException' with message 'Class MongoException does not exist' in /var/www/projectfolder/vendor/laravel/framework/src/Illuminate/Exception/Handler.php:310\nStack trace:\n#0

    Any one can help ?

    Thanks in advance

enter image description here

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

1]Create index using following MongoQuery

db.user.createIndex( { "location" : "2dsphere" } )

2]Ensure that Index applied or not using following command

db.user.ensureIndex( { "location" : "2dsphere" } )

3]Check following Mongo Query in MongoDB Console.It's working

db.user.find(
    {"location" : {
        "$nearSphere": {
            "$geometry": {
                "type": "Point", "coordinates": [72.513723 , 23.041388] 
            },
        "$maxDistance": 8000,
        "$uniqueDocs": 1
        }
    }
})

After two days investment, i got this solution to resolved this bug by googling and different rnd steps perfomred on MongoDB

over 4 years ago · Santiago Trujillo Denunciar

0

Please add your mongo class to app.php. Like in my file I have added like this.

   'Jenssegers\Mongodb\MongodbServiceProvider',

Above is my app class. You have to add your library class.

Second reason is, Are you using db instead of DB in code? anywhere. And if you have followed above steps then run following command in cmd:

composer update, then composer dump-autoload

Do let me know if you need any help. I have same error in Laravel 4.2 and I solved by this steps.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda