autoload.php is a conventional name for a file which loads a bunch of other php files.
PHP packages typically come with an autoload.php file.
Composer, the tool that installs the MongoDB PHP library on top of PHP’s own MongoDB driver, installs all the packages you install via Composer in a directory called vendor. It’s just like npm in Javascript where everything is installed in a project subdirectory called node_modules.
So typically for PHP + MongoDB you:
- make sure the PHP driver
mongodb.sois installed and called out in yourphp.inifiles for web and for cli - create your project directory
- use Composer to install MongoDB’s PHP Library in your project directory, which results in you having a
./vendorsubdirectory of your project
Then, in your program code, require_once ./vendor/autoload.php which loads all the modules Composer installed in your ./vendor subdirectory of your project.