Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

163
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda