What is the best way to do local development/testing for PHP web development (OS X)?

I know that OS X 10.6 comes with PHP 5.3 and Apache 2, but is this really the best way to do local development? Is the use of something like MAMP common? How can accurate testing be done when you have a dynamic site with MongoDB, node.js, etc?

Right now I edit over FTP, but I want to change this since I know this isn’t ideal. It seems to me that doing it locally is just a big hassle and will really hamper my productivity. I assume I’m missing something?

Accurate testing? You make it sound like PHP like HTML has browser differences. As long as you use a relative configuration like the one on the development server it should be fine. Writing portable code is not all that difficult with PHP. With local development, you don’t have to FTP or do anything of that nature just refresh your browser that is pointed at “localhost”.

That doesn’t sound very accurate to me. Yes, of course the PHP will behave teh same, but there are a lot of other variables (databases, etc). I’m just trying to think of this from a workflow perspective since I’m trying to figure out the “right” workflow after doing it “wrong” for so long.

MAMP is a much simpler option than setting up everything yourself on your local computer. MAMP includes the database, too. So any site that runs on Apache, MySQL and PHP can be set up through MAMP. It’s very simple to set up. If you get MAMP Pro, there are a few extra features, such as setting up a virtual host (meaning that the url in your browser will be [noparse]http://mysite.com[/noparse] and thus match the online version, which is handy) though you can manually set up the standard MAMP to do this too.

A virtual machine, always a virtual machine; at least for me anyway. :slight_smile: