

Ask HN: Working with Apache/PHP on OSX - runningskull

I just got a new MacBook (first time using OSX on a day-to-day basis) and I'm trying to set up my development environment on it. I'm trying to evaluate my web server options. I am used to using Linux, so I am figuring out how to migrate over.<p>I've read a lot of articles about different ways, but haven't found the "preferred" way. So, should I use the server that comes with OSX, or should I use something like XAMPP or MAMP? Or something else entirely?<p>Also, what's the best way for installing/managing PHP modules. Ubuntu made it really easy (well, Debian did, really) by having packages for all of the major PHP modules. Is there something similar for the Mac? Is this what MacPorts is for?<p>Basically I'm looking for the "standard" way of setting up a LAMP stack (minus the L) for OSX and a nice way of dealing with PHP modules.<p>Thanks, HN!
======
smoody
Definitely start with MAMP, in my opinion. As it doesn't build/install
anything itself, it keeps your system ultra clean. If you need to move beyond
it, just drop it in the trash and you're done. A few hints:

\- By default, the apache doc directory is mapped to an os directory inside of
the MAMP folder. Change this to something in your ~ directory right away so
that if you upgrade MAMP, you won't accidentally write over your work.

\- Make sure MAMP dirs are at the beginning of your shell path because there
are conflicting binaries pre-installed in OS X (basic, I know).

\- In my opinion, the MAMP PRO upgrade is worth it. It gives you much finer
control over many things.

\- I've only compiled and installed the memcache pecl extension and I did that
through the standard make/install process and it worked fine. I just had to
drop the memcache.so file into the proper directory and find the right php.ini
file to edit to enable it. See this post (and my comment -- 2nd from the end
-- to see how to configure MAMP PRO): [http://www.lullabot.com/articles/setup-
memcached-mamp-sandbo...](http://www.lullabot.com/articles/setup-memcached-
mamp-sandbox-environment). Note: I did not use their process to build the
extension, I used this:
[http://www.ibm.com/developerworks/opensource/library/os-
php-...](http://www.ibm.com/developerworks/opensource/library/os-php-
fastapps3/#build_memcache) .

\- I don't think there is strong support for php pecl extensions in MacPorts,
but MacPorts is great for a great many things. For example, I used it to
install the memcache daemon.

I hope that helps.

~~~
runningskull
Thanks a lot. I just installed MAMP and MAMP Pro, and it seems pretty seamless
and easy. The "Mac Way" if you will.

I appreciate all the help!

