LAMP
-- L
inux -- A
pache -- M
ySQL -- P
HP
The LAMP
development stack is key to understanding the Web. How nice would it be to have the full stack right on your machine, in the most natively possible form, especially on a macbook (pro) or ultraportable macbook air?
- Linux. OS X is Unix based, already 95 percent compatible with the linux world, yet not nearly as susceptible to DSO problems.
- Apache. System->Preferences->Sharing->Web Sharing, checkmark the box. The base url will then be displayed as a link right there in the preferences pane. Click the link to view your local web server root documents served by default from /LIbrary/Webserver/Documents
- MySQL. http://dev.mysql.com/downloads/mysql/ to download an OS X binary that installs just like any other application in OS X.
- PHP. Built in, not enabled by default.
To enable PHP in OS X, open the Terminal.app and enter:
pico /etc/apache2/httpd.conf
then either uncomment or add this ilne
LoadModule php5_module libexec/apache2/libphp5.so
Then still in Terminal
sudo apachectl restart
Then verify php is enabled by creating a 3 line text file named info.php in /Library/Webserver/Documents.
<?php
phpinfo();
?>
Then in Safari or favorite browser, go to http://localhost/info.php
A bunch of php information should display, along with Apache and MySQL info.
Any problems, http://www.entropy.ch is the most solidly knowledgeable and authoritative place to begin troubleshooting.
