Run live and developer Apache, PHP and mySQL in OS X using Entropy & MAMP: Solved

Installing Apache is as easy as going to your system preferences, clicking on Sharing, clicking on Personal Web Sharing, and clicking on ‘Start’. Are you kidding?? Installing apache is that easy? Holy crap!
Then if you put files in your ~/Sites/ folder, you can view them by going to http://127.0.0.1/~yourusername/, where yourusername is your short login name. Wow, that was easy!
Because verizon was blocking port 80 on my DSL, I changed the port number easily:
Edit /etc/httpd/httpd.conf and edit this line:
#
# Port: The port to which the standalone server listens. For
# ports < 1023, you will need httpd to be run as root initially.
#
Port 80

Change it to 8080 or whatever you want. You may need to forward this port on your router as well.

For PHP, you could use Apple’s default PHP by uncommenting some lines in your config files, but I’d recommend using entropy:

http://www.entropy.ch/software/macosx/php/

You can download and install PHP 4 and/or PHP 5 by downloading the dmg and double clicking the package. Sweet!

Finally, let’s install a private Apache, PHP and mySQL server for a private testing environment. Download MAMP:

http://mamp.info

Drag the application into your Applications folder, and double click on MAMP. Holy crap, it’s running! Files for your testing environment go into your /Applications/MAMP/htdocs folder.

You can view those files by going to http://localhost:8888/. Apache is running on default port 8888, and mysql is running on default port 8889. You can switch between PHP 4 and PHP 5 with a click of a radio button. The servers will run as long as you have the application running, or you can have them keep running when you close it.

Amazing!

Trackback this Post | Feed on comments to this Post

Leave a Reply

You must be logged in to post a comment.