Apache ForceType application/x-httpd-php and PHP CGI

To display “static” pages here I use the Apache “ForceType” directive so that all requests to /pages/something get processed by a php file called “pages”. Unfortunately that doesn’t work as easily when PHP is running as a CGI.
I found a possible solution in this Textpattern forum thread. Not sure if you can put “ScriptAlias” into a .htaccess file. I just checked and no, you can’t. That limits the usefulness of this solution dramatically!
Here’s how to use PATHINFO to create search engine friendly URLs. Again, it uses the ForceType idea.
Looks like it’s worth perceivering with mod_rewrite after all!

Dangers of SQLite Ignorance

Aaron doesn’t explicitly list the dangers but I can guess that they include overwriting db files. I haven’t looked at SQLite yet however, it’s on the TODO list! 🙂
OK, I read the comments, it’s no more dangerous than having text files lying around, although as the file has to be writeable by the webserver that guarantees certain responsibilites when using them!

Perl and PHP Stuff

Via delicious this morning I have two titbits for your consumption!
Movable Type Ported to PHP – Apparently they’ve done what appears to be a nearly complete port of MT from Perl (bless it) to PHP. This port appears to include support for all current MT tags, it relies on Justin Vincent’s ezSQL DB library and Smarty templates, and even supports a plug-in API.
Why PHP still stinks – from a Perl coder’s perspective. 😉

Compress Me!

This technique is an old one. Feed your content through the PHP output buffer using the gzip handler, then at the end flush it out to the browser.
Even if the text doesn’t compress well, just using the output buffer results in slightly less network traffic as the data is sent in one big blob. I have to investigate if the HTTP headers are affected yet but it seems to be working fine.