By nawfal
Hi,
Please I would like to know how could I install the extension and the library of MongoDB on App Platform with PHP.
I’ve tested this composer.json and it doesn’t work:
code
{
"require": {
"ext-mongodb": "*"
}
}
I’ve also tested “ext-mongo” instead of “ext-mongodb”. And also “ext-mongodb”: “^1.10.0”.
It displays me this error: “Build Error: Non-Zero Exit”.
The MongoDB database is on Digitalocean, and it’s linked to the app as a component.
Thank you!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
👋 @nawfal
I don’t think that error is related to the MongoDB. Build Error: Non-Zero Exit means that during build/detection the app errored, since PHP apps generally don’t compile, this is commonly caused by a missing composer.lock file.
Also, DigitalOcean MongoDB instances require connecting with a CA certificate. You can use bind variables to inject it by creating an environment variable like: CA_CERT=${db-mongodb-nyc1-12345.CA_CERT}.
Hope this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.