Actions/PHP
Sam Angove
peasant at gmail.com
Wed Dec 7 06:55:18 EST 2005
On 12/7/05, Julian 'Julik' Tarkhanov <listbox at julik.nl> wrote:
>
> I tried to do it sometime ago to process .markdown files this way
> with PHP, and it looks like you need to have Apache2 (which has
> Actions).
According to this[1] mod_actions is available for Apache 1.1+. I'm
using them with 1.3.something right now, so that sounds about right.
They're no good with PHP-CGI, though; you get the dreaded "no input
file specified" error. I couldn't work out a way around that.
<?php
// markup.php
require_once('markdown.php');
if (! $file = file_get_contents(
stripslashes($_SERVER['PATH_TRANSLATED']) )) {
// something has gone wrong; issue an error
}
// include header etc...
echo markdown($file);
// footer
?>
And in .htaccess (etc.) --
AddHandler markup .text
Action markup /markup.php
DirectoryIndex index.html index.php index.text
[1]: http://www.google.com/search?q=cache:http://httpd.apache.org/docs/1.3/mod/mod_actions.html
More information about the Markdown-Discuss
mailing list