Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases Mongo Basics Understanding MongoDB Store Your Blog In Mongo

Pierre Smith
Pierre Smith
11,842 Points

how to get mongo onto a LAMP server?

When thinking about developing a web app that eventually has to be pushed to a server would it be better to install Mongo manually and keep it in the project folder or is homebrew still a better option?

I'm aware that mongo will have to be install onto the server that the app is being pushed to, but how would that effect the app if your migrating an app from a machine that has it installed via homebrew on to a server that has it installed manually?

2 Answers

First up, homebrew is for Mac OS X, so that's not going to help for installing on Linux. Here is a list of supported platforms for MongoDB and instructions on how to install on Linux.

Then you'd need a driver for PHP so you can access the database from your PHP scripts: PHP MongoDB Driver.

As far as 'migrating' your code, ideally your PHP scripts would be the same, regardless of the platform they were running on, with probably the exception of some configuration code (database connection strings, environment variables, etc). The rest you could put in a Git repository and clone it to wherever you need it. And leave any specific config data out and just add instructions on how to set it up.

wow I love home brew, isn't that awesome!? I got one from the pawn shop for 300 and installed my own operating system, I think it was snow leopard at the time; a conundrum migrating data onto the new OS supposedly updated manually which was a great opportunity at the time. I missed out on my privacy apps, like "firefox fusion" I think it was called, I think. To see who was looking at my data, third party data sellers that would magically tag along through the network before IPv6 maybe? Anyway Im not sure if it is on Darwin architecture or not the homebrew program was instantiated at a date?.