XAMPP, MAMP & MongoDB

In order to execute code in PHP that interacts with the MongoDB server you should install the MongoDB driver in your PHP execution environment. Using MAMP, I spent lots of hours finding out that MAMP doesn’t come will all source code files of PHP in order to allow you building the mongo.so file. The mongo.so file is the Mongo extension we should create and place together with all other extensions in our PHP execution environment.

In order to overcome this problem, I chose to create the mongo.so using the XAMPP execution environment and then copy it to my MAMP execution environment. The video clip below overviews all steps, including the basic steps of installing MongoDB, turning on its serverand perform basic operations.

When adding the mongo.so file to your PHP execution environment make sure you don’t forget to update the php.ini file. The “extension=mongo.so” line must be added to it. In addition, make sure you restart the server before you test drive your code.

If you want to save time on your end and avoid the building process of the mongo.so file on your end, you might want to use the one I created. It works fine with PHP 5.6.10. This is the PHP version I am using.

Share:

The Visitor Design Pattern

The Visitor Design Pattern

The visitor design pattern allows us to add operations to objects that already exist without modifying their classes and without extending them.

What are Anti Patterns?

Anti Patterns

Unlike design patterns, anti patterns just seem to be a solution. However, they are not a solution and they cause additional costs.

Virtual Threads in Java Professional Seminar

Virtual Threads in Java

The use of virtual threads can assist us with improving the performance of our code. Learn how to use virtual threads effectively.

NoSQL Databases Courses, Seminars, Consulting, and Development

MongoDB Design Patterns Meetup

The use of MongoDB involves with various cases in which we can overcome performance issues by implementing specific design patterns.

image of woman and database

Record Classes in Java

Learn how to define record classes in Java, and when to use record classes in your code. Stay up to date with the new Java features.

Accessibility | Career | Conferences | Design Patterns | JavaScript | Meetups | PHP | Podcasts | Python | Self Learning

Teaching Methodologies | Fullstack | C++ | C# | CSS | Node.js | Angular | Java | Go | Android | Kotlin | Swift | Academy

Front End Development | Scala | Architectures | Cloud | Big Data | Internet of Things | Kids Learn Programming

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Skip to content Update cookies preferences