Apache and PHP Setup on Mac OS X
This special tutorial is for a friend who would like to learn PHP on Mac but do not know how to setup Apache and PHP. Follow few step below and I think your Apple Powerbook should work.
Step 1: Edit Apache conf File
First open the terminal program in your Mac, it can be found in Application > Utiilties > Terminal. After the terminal is open, follow the command as below.
In case you do not know, the Terminal icon looks like this

After you have opened the Terminal, now type the command;
> cd /etc/httpd
> sudo nano -w httpd.conf

And now, you will need to key in your account password. After that, your terminal might look something like below.
Yes, now you will need to edit the apache config file. With the command;
> Ctrl + w // this is to perform some search
> php // to search the word “php”
When you have got the word “PHP” searched, edit the file value exactly the same as the screen shown below.
After you have edited the config file, save and exit with the command;
> Ctrl + O // save it httpd.conf
> Ctrl + X // to exit
Ok, now the httpd.conf file is edited and PHP is enable! Next, to start Apache.
Step 2: Start Apache Web Server
How to start your apache web server? Ahh, in Mac is damn easy, doesn’t need command like /usr/local/apache/bin/apachectl start!! First, go to System Preferences > Sharing.

Now start your web!
Yes, you are done now! Open your favourite internet browser, access your web http://192.168.x.x/~accountname. You web file is store in your account folder named Sites.
Done! To learn more about PHP, Go to PHP Official Website
Tags: PHP, Apache, Mac OSX, Apple iBook







