Is there a way to compile php as cgi? If so, what do I need to do, where can I get a compiler, etc..
I don't think that it would be compiled. I think you just write your scripts with PHP instead of Perl or whatever. Besides why would you want to use it as CGI. It would just slow it down.
There is supposed to be a compiler at zend.com.
But the beauty of PHP is that you don't need to compile the scripts.