1.LinuxThe mongodb class is instantiated.
<?php $manager = new MongoDB\Driver\Manager("mongodb://localhost:27017"); var_dump($manager);
2.windowThe mongodb class is instantiated.
$ip = "127.0.0.1"; $port = '27017'; $dns = 'mongodb://'.$ip.':'.$port; $manager = new \MongoClient($dns); var_dump($manager);
3.Is a program instantiation divided into operating systems, so that the development environment and production environment need not be unified?
Nothing to do with the operating system. This is the problem of mongodb extension that you install.
The two platforms use a set of extended libraries without changing code.
You were the two version that you used to use.
The second version is the form I’m using now. Windows, MAC, Linux general-purpose
LinuxDo you use second ways to report errors, or do you use the first method to report errors on window?
Otherwise how do you know it’s not uniform