I was also having this issue and found the solution in a single character in php.ini: be sure that the variables_order setting begins with "E" (mine was missing):

variables_order = "EGPCS"

It looks like the issue was due to PHP's $ENV global being left empty due to this setting. I'm guessing this is because of the default "production" php.ini that ships with the PHP distributed with MacPorts. 

I've posted a few additional links and error output on our development blog: http://echodittolabs.org/blog/2010/03/fixing-textmates-php-commands-macports-php

--

Ethan Winn
ethan@echoditto.com