« doc.php.net API docs online | Main | Just my luck ;) »

Using php5-fcgi

I suppose one of the things that was hacking me off about php5-fcgi was that it was ignoring the .htaccess file (rightfully so) and required a bit of tweaking of a custom php.ini for the php fastcgi to utilise so that one would get certain settings going prior to utilising my normal auto-prepend file.

For the past few weeks I've had to have quite a bit of stuff towards the top of my php scripts:

<?php
if ($_SERVER['SERVER_ADDR'] == 'XXX.XXX.XXX.XXX') {
    
ini_set ('include_path', '*snip*');
    
ini_set ('magic_quotes_gpc', 'off');
    
ini_set ('magic_quotes_runtime', 'off');
    
ini_set ('register_globals', 'off');
    
ini_set ('display_errors', 'on');
    
ini_set ('display_startup_errors', 'on');
    require_once
'powertrip-prepend.php';
}

Using the custom php.ini for the php5-fcgi one can manually edit the custom php.ini and set various settings which you would have normally have set in your .htaccess or httpd.conf depending on your environment.

Anyway I changed the line from:

PHPRC="/usr/local/etc"

to

PHPRC="/home/jacques/etc/php5"

which sorted out a couple of "issues" I was having. I have in the past always prefered using the apache configuration file for storing various settings for the virtual host including php specific settings.



TrackBack

TrackBack URL for this entry:
http://www.powertrip.co.za/blog/mt-tb.cgi/389

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)