PHP as FastCGI?

I’ve not found anything about this in the KB or wiki so I’m guessing it’s not possible, but… can PHP be run as a FastCGI module?

The main reason for wanting to do this is that you can have your own custom php.ini file (no more crappy workarounds for magic_quotes_gpc being on!). See: (most useful for Dreamhost admins)

Also I believe performance should be enhanced - we may not notice it but hopefully the server admins would :slight_smile:

I have PHP running using FastCGI on my APIdoc site.

I compiled PHP 5.1.1 with --enable-fastcgi and copied the php binary into my web directory as cgi-bin/php.fcgi. In my .htaccess file I’ve added a PHP handler that points to php.fcgi:

AddHandler custom-php .php
Action custom-php /cgi-bin/php.fcgi

If you just want magic_quotes_gpc switched off, you may want to take a look at Dreamhost’s existing PHP 5 configuration. This has magic_quotes_gpc and register_globals switched off.

Thanks, I’m avoiding PHP5 at present as I don’t have the time to test my sites for problems with it.

Adding FastCGI to the default PHP build that Dreamhost provides would mean users would not have to compile custom PHP binaries just to get their own php.ini file :slight_smile:

Am I missing something?
FastCGI exists as the 3rd main option (4th if you count the PHP5 sub option) in the Domains -> Manage Domains (click edit on your domain of course) section…

VxJasonxV: I believe so - that only enables it for whatever’s compiled to support FastCGI. If you look at a phpinfo() you’ll see that PHP is only compiled to use the CGI architecture.