Easiest way to install Apache2, PHP and MySQL in Mac OS 10.6 (Snow Leopard)

I’m so amazed on how web development (static or dynamic) is readily prepared by Snow Leopard for you.

You see, I was shocked when I bought my Macbook Pro, and its got Ruby and RubyGems already installed in it, so what I did was just install Rails gem and so forth.

And now for my new web application, I decided to use PHP.So I hurriedly searched the internet on the how to’s of php installation in Mac. After doing a lot of searching/reading, I’ve found the quickest possible installation of the 3! And it’s even easier than XAMPP in Windows. 🙂

Note: This installation only possible in Mac OS 10.6, and not sure if this works on other Mac OS versions

Apache2 and PHP is actually installed in your Mac already by default, so what you’re only going to do is to activate PHP to use Apache2 webserver (don’t you just love 10.6?!). In order to do that, you just edit Apache2 httpd config:

vi /etc/apache2/httpd.conf

and locate the line that contains: 

 #LoadModule php5_module libexec/apache2/libphp5.so

remove the # symbol, then save!

Installing MySQL is also easy when you have MacPorts installed in your system. If you do, just type this on your terminal:

sudo port install mysql5

And that’s it, MySQL is installed. You can also do more configurations to your MySQL setup, just read more here. And if you want the brute way of installing it, check it here.

After you have installed MySQL, you can now paste your PHP project in this directory:

cd /Library/WebServer/Documents

And that’s it, you’re done! You check it on your web browser, go to http://localhost/project_name and it will show you your default welcome page.

 

Leave A Comment

Please be polite. We appreciate that. Your email address will not be published and required fields are marked