PHP as FastCGI?

software development

#1

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:
http://kics.bc.ca/faq/phpini.html (most useful for Dreamhost admins)
http://kb.textdrive.com/article/creating-your-own-phpini

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


#2

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.


#3

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:


#4

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…


#5

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.