TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Working with Apache/PHP on OSX

1 pointsby runningskullover 16 years ago
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!

1 comment

smoodyover 16 years ago
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:<p>- 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.<p>- 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).<p>- In my opinion, the MAMP PRO upgrade is worth it. It gives you much finer control over many things.<p>- 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): <a href="http://www.lullabot.com/articles/setup-memcached-mamp-sandbox-environment" rel="nofollow">http://www.lullabot.com/articles/setup-memcached-mamp-sandbo...</a>. Note: I did not use their process to build the extension, I used this: <a href="http://www.ibm.com/developerworks/opensource/library/os-php-fastapps3/#build_memcache" rel="nofollow">http://www.ibm.com/developerworks/opensource/library/os-php-...</a> .<p>- 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.<p>I hope that helps.
评论 #438728 未加载