Setting Up DAMP

This section will help you decide on the language for your DAMP system (the P port), how to install and configure MySQL, and how to further configure Apache to use Perl and PHP.

Choosing a Language

You should probably have some proficiency in at least one of the “P” languages, even if your site is going to run code written by others. The following is a very brief rundown on the individual strengths of these languages.

PHP

PHP is the only language of the three designed entirely with web programming in mind; it boasts web-page embedability among its core features. It is arguably the best of the three for building very simple database-backed web applications, and may be the fastest to pick up and learn, given its ability to immediately show results in a web browser.

However, it’s very hard to extend, since adding new functionality means recompiling the PHP software itself; it isn’t modular, as Perl and Python are.

Perl

Perl is a general-purpose programming language that excels at handling text—since any web page is really just a long string of text, Perl has been a natural choice for crafting dynamic web sites for as long as the Web has existed.

Perl is the oldest of the three languages, with a history going all the way back into the 1980s. Without a doubt, it enjoys the most support. Anyone can extend Perl through writing modules (in either Perl or C), and the famous Comprehensive Perl Archive Network (CPAN, headquartered at http://www.cpan.org) serves as a globally ...

Get Mac OS X in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.