The attached php-cgi.tgz contains a modification of php-4.1.2-r3 which allows it to be installed without Apache, and thus, as a CGI binary. In addition, there is a "dummy" php-cgi-1.0.ebuild file which does nothing but calls "NO_APACHE=1 emerge php" so that whatever the latest version of PHP is, it will be installed. The reason that I believe it is best to have a fake-seperate-package for php-cgi is so that other packages which rely on having a php binary (such as PHP-Mole, which i'd love to port to portage) can list it as a dependency. It also allows you to have both a CGI binary and the apache modules at the same time. I don't know if this is the "best" way to accomplish this with ports--but i'm submitting this solution to raise awareness :)
Hell if I know why, but when I try to submit a file attachment, it says, 'File was not provided, or is empty.' Except its so not. Anyways. http://ixokai.net/php-cgi.tgz is the file mentioned.
Nevermind. I could have swore it worked :P It didn't, though. :)