Thinking of switch to PHP w/Fast CGI?

Posted on Monday, Aug 18, 2008 at 01:10 AM in ,

If you're contemplating switching to running PHP5 under FastCGI, to take advantage of apache's threaded worker model and improve your server's performance, think again.  If you're used to setting and overriding php values via .htaccess files or using php_value/php_flag in your virtual host directory, this is not supported with FastCGI.  You'll have to figure out how to set those values via some other means.  Some PHP ini directives can be set in your script directly, with ini_set, but others have to be set outside of it (register_globals for example).  There are ways to set them, but making the switch from prefork to worker is not trivial, especially if you have multiple PHP applications on a single server.

Why we like php-fastcgi and its flexibility

So if you’d like to use php-fcgi but still need some flexibility with your php configuration, (since the php-fcgi scripts are just wrappers) you can create php.ini files for whatever feature-set you need, duplicate the wrapper scripts, defining different PHPRC values for each, then use a .htaccess in each of the subfolders to define which one of the wrappers to use with the following directives.

 

Comments

says

Posted Wednesday, Dec 31, 1969 at 07:00 PM

Post your comment

Required but will not be shown
URL for your own blog or site - begin with http or https.
Most HTML is allowed.
The values you submit will be saved to a cookie to automatically fill in this form.
 Yes, save it.

Meta

Links Out

Links In

View blog reactions

Technorati Tags

Feed

License

Subscribe via Email

Enter your email address:

Delivered by FeedBurner