Go to content Go to navigation Go to search

Tread lightly on the things of earth

Mike’s weblog about computing, politics, and faith (a progressive view)

Tags: , , , Local Textpattern development in MAMP?

MAMP provides Mac OS X (Panther) an utterly self-contained and easy-to-manage install of Apache2, PHP4, PHP5, and MySQL (also phpMyAdmin and MMCache) for up-to-date Web developing.

MAMP logo, by WebEdition

2005-08-13 update:
MAMP v1.0.1, released August 1, 2005, comes with mod_rewrite built in. So now, out of the box, everything just works. Probably more goodies packed in this version, too, that I haven’t noticed yet. webEdition guys, you’re awesome.


MAMP provides Mac OS X (Panther) an utterly self-contained and easy-to-manage install of Apache2, PHP4, PHP5, and MySQL (also phpMyAdmin and MMCache) for up-to-date Web developing. Textpattern (Txp) served locally this way seems faster than from my more involved local PowerBook Apache2/PHP/MySQL install. And MAMP is 100 times simpler to configure than a system-wide install of these apps; there’s almost nothing to it. (IOW, it’s reproducible without extended effort.)

But MAMP’s Apache2 doesn’t come with mod_rewrite (as of v1.0a3 dated 12-29-2004). Drat. So Alex’s Txp plugin zem_rewrite doesn’t work, and most disappointingly, its custom permalink function.

To get Txp’s clean URLs to even work in MAMP without mod_rewrite, I had to use Marcello’s tip:

To get clean URLs without mod_rewrite, I have the following file in TXP root (I called it section):

<?php
include "./textpattern/config.php";
$s = basename($_SERVER[SCRIPT_NAME]);
include $txpcfg['txpath']."/publish.php";
textpattern();
?>

Then I make symlinks to it with: ln -s section sectionname

My question to myself is, can I develop in this rewrite-constrained local context and then deploy at rewrite-enabled TextDrive (my webhost) — as I’m doing now ‘cause I love mod_rewrite — or would I risk less confusion by keeping local and deployed Txp installs ~identical no matter what?

2005-01-29 update:
A quick and inadequately tested workaround seems to be working:

  1. Temporarily install Server Logistics’ Apache2
  2. Copy its /Library/Apache2/modules/mod_rewrite.so to /Applications/MAMP/bin/apache2/modules/
  3. Edit /Applications/MAMP/conf/httpd.conf to add this line in the LoadModule section:
    LoadModule rewrite_module modules/mod_rewrite.so
  4. Restart MAMP’s servers

Then mod_rewrite — and hence, clean URLs and zem_rewrite — works in MAMP.