You must first provision your application with a MongoDB database from the dashboard. If you are using an external MongoDB database, you are not required to provision a database with your app. To deploy your application follow the instructions below:
Log in and navigate to the Dashboard. Click on deployments and complete the form. You will be required to select the size of your container and the region where your cluster is to be hosted.
After your application is created, click on the Task Manager > App actions > PHP developer
For those using the lastest driver and most likely initiating their PHP client as "new MongoDB\Client("mongodb://localhost:27017");", you are using the new driver and must specify the mongodb extension. You must select a PHP 7.x version and select the mongodb extension
You can use composer here as well, if you run composer require mongodb/mongodb on your terminal, make sure you have the require 'vendor/autoload.php'; in your code. See the official PHP MongoDB docs for more details
If you face any issues, do not hesistate to open an issue in our forums, our team will help you right away
It is important you understand, PHP has two drivers which is the legacy mongo driver and the latest driver which is the extension mongodb
If your application receives the error "Class 'MongoClient' not found" (see issue) or in your code you are connecting to MongoDB using new MongoClient(""), that means you are using the old driver and must use PHP version 5.6 on NodeChef for this to work.
Select PHP 5.6 and then select the mongo extension