The situation is as follows. On Dev server, several projects are being developed simultaneously on both the 5th and 7th versions of PHP.
Live server is
- PHP 5.5.23
- mongo 1.6.6
extension_loaded ("mongodb") = false
extension_loaded ("mongo") = true
Dev server is
- PHP 7.0.8
- mongodb 1.1.8
extension_loaded ("mongodb") = true
extension_loaded ("mongo") = false
The site is written in Yii2, therefore, to climb and change something in the Framework is a bad idea.
Dev server starts to pour errors like these
Class 'MongoDate' not found
Class 'MongoClient' not found
As I understand it because of the backward compatibility of mongo and mongodb drivers. I tried to write my own wrappers classes and update versions of yiisoft / yii2 and yiisoft / yii2-mongodb. But this is also a very bad idea, as some "exotic" pieces of code have become incompatible with the new version.
Here is a piece of composer.json with packages.
"minimum-stability": "beta", "require": { "yiisoft/yii2": "2.0.4", "yiisoft/yii2-mongodb": "2.0.1", } "minimum-stability": "stable", "require": { "fxp/composer-asset-plugin": "v1.1.4", "yiisoft/yii2": "2.0.9", "yiisoft/yii2-mongodb": "2.1.0", } Is there a light at the end of the tunnel?