Joystiq has your stash of criminally complete GTA IV news!

Apache and PHP on a Mac

os x apache phpOne of the very first cool things I learned about the guts of OS X was the existence of Apache, an industrial-strength web server, built in to the OS. O'Reilly has a nice piece on getting started with Apache, so start there if you're new to web serving on your Mac. Imagine hosting your own pages for your own home intranet. Now take that one step further, and imagine dynamic pages, ones capable of accessing data from the web or your machine, on your home network (or using DynDNS, anywhere).

I'm going to point out a few resources for getting started using Apache and PHP on your Mac. You'll find the combination powerful, and getting up to speed is relatively simple. There's some programming involved, so if you're scared of that sort of thing, check out How to Think Like a Computer Scientist: Learning with Python. Granted, you'll be learning Python, but guess what? You can use Python on your Mac as well. Python goes beyond  web programming, and is a great language to get familiar with. If you want to learn PHP, check out Webmonkey's PHP section, or W3 School's PHP intro.

Apple has a page on getting PHP working on your Mac. It's a nice article too, with a step-by-step building of a page to view your iTunes library, complete with plenty of XML goodness as well. The problem here is the version of PHP that comes with your Mac is generally a version behind the current release. While PHP 4.3 was nice, version 5 adds some great stuff. The version of Apache shipping with your Mac probably isn't the latest rev of that either, so check out phpmac's tutorial on installing Apache 2.20 and PHP 5.1.2. It's only for OS X version 10.4.4, but it'll still work with 10.4.5 (no warranty expressed or implied, back up your data, etc.).

Once you have more current versions up and running, try out some of those programming resources, and try building apps. I think you'll find while Apache keeps your Mac acting like a great web page server, PHP can turn your private pages into real network apps. What's really great about setting up PHP on your Mac isn't just a home network, but being able to build and test web apps too, all from the comfort of your favorite OS.

Reader Comments (Page 1 of 1)

TUAW Features

Mac 101 iPhone Around the Worldask-tuaw
Mac News
Macworld (488)
.Mac (37)
Accessories (608)
Airport (69)
Analysis / Opinion (1273)
Apple (1577)
Apple Corporate (533)
Apple Financial (180)
Apple History (39)
Apple Professional (47)
Apple TV (153)
Audio (438)
Bad Apple (117)
Beta Beat (142)
Blogging (83)
Bluetooth (15)
Bugs/Recalls (56)
Cult of Mac (857)
Deals (197)
Desktops (114)
Developer (205)
Education (93)
eMac (10)
Enterprise (125)
Features (368)
Freeware (356)
Gaming (337)
Graphic Design (19)
Hardware (1251)
Holidays (37)
Humor (568)
iBook (65)
iLife (229)
iMac (182)
Internet (298)
Internet Tools (1267)
iPhone (1315)
iPod Family (1979)
iTS (941)
iTunes (779)
iWork (17)
Leopard (343)
Mac mini (109)
Mac Pro (49)
MacBook (196)
MacBook Air (70)
Macbook Pro (213)
Multimedia (421)
Odds and ends (1391)
Open Source (267)
OS (871)
Peripherals (183)
Podcasting (180)
Podcasts (83)
Portables (195)
PowerBook (135)
PowerMac G5 (49)
Retail (550)
Retro Mac (46)
Rig of the Week (42)
Rumors (596)
Software (4164)
Software Update (384)
Steve Jobs (246)
Stocking Stuffers (50)
Surveys and Polls (97)
Switchers (107)
The Woz (33)
TUAW Business (222)
Universal Binary (279)
UNIX / BSD (60)
Video (891)
Weekend Review (74)
WIN Business (47)
Wireless (78)
XServe (33)
Mac Events
One More Thing (25)
Liveblog (0)
Other Events (222)
WWDC (183)
Mac Learning
Ask TUAW (96)
Blogs (84)
Books (24)
Books and Blogs (62)
Cool tools (437)
Hacks (450)
How-tos (467)
Interviews (33)
Mods (180)
Productivity (577)
Reviews (99)
Security (142)
Terminal Tips (55)
Tips and tricks (552)
Troubleshooting (160)
TUAW Features
iPhone 101 (23)
TUAW Labs (3)
Blast From the Past (16)
TUAW Tips (137)
Flickr Find (32)
Found Footage (64)
Mac 101 (75)
TUAW Interview (31)
Widget Watch (196)
The Daily Best (1)
TUAW Faceoff (4)

RESOURCES

RSS NEWSFEEDS

Powered by Blogsmith

Sponsored Links

The Unofficial Apple Weblog (TUAW) bloggers (30 days)

#BloggerPostsCmts
1Dave Caolo500
2Cory Bohon454
3Mat Lu405
4Scott McNulty342
5Erica Sadun331
6Michael Rose2619
7Brett Terpstra230
8Steven Sande229
9Mike Schramm204
10Robert Palmer1827
11Joshua Ellis84
12Christina Warren518
13Nik Fletcher41
14Chris Ullrich32
15Jason Clarke11
16Lisa Hoover11
17Victor Agreda, Jr.14

Featured Galleries

Macworld 2008 Keynote
Macworld 2008 Build-up
Macworld Expo 2007 show floor
The Macworld Faithful in Line
iPhone First Look
iPhone 2.0 - .Mac push e-mail
iMac 1998
TUAW Faceoff: Screenshot apps on the firing line
Boston Apple Store (Boylston Street)

 

    Most Commented On (7 days)

    Recent Comments

    More Apple Analysis

    More from AOL Money and Finance

    Weblogs, Inc. Network

    Other Weblogs Inc. Network blogs you might be interested in: