Project

General

Profile

[Solved] Undocumented fix for setting up fastcgi.server in config file

Added by wagnered almost 9 years ago

I downgraded my php installation from php5.5 to php5.4.39 and could not get lighttpd to load the php.ini file. PHP5.5 worked with the "basic" fastcgi.server configuration. Manually starting PHP5.4 php-cgi with the -c switch loaded the php.ini file. I ended up adding the following:

fastcgi.server = ( ".php" => ((
                     "bin-path" => "/usr/local/bin/php-cgi@ *-c /etc/php.ini*"@,
                     "socket" => "/tmp/php.socket",
                       "bin-environment" => (
                         "PHP_FCGI_CHILDREN" => "1",
                         "PHP_FCGI_MAX_REQUESTS" => "10000",
                       ),
                     "max-procs" => 3,
                     "broken-scriptfilename" => "enable",
                     "PHPRC" => "/etc/php.ini" 
                 )
    )

The "PHPRC" statement I found somewhere during my search did not help by itself.
The addition of -c /etc/php.ini to the "bin-path" parameter did the trick, but it was a way out-of-the-box attempt as none of the searching I did displayed this as a fix or work-around.

I spent a lot of time building several versions of php because all the php documentation indicated that php would automatically load the php.ini from the default configuration path. even defining the php configuration file path during build did not help.

I don't know if this is a php or a lightty bug: So I was curious if I discovered an undocumented fix or did I luck into it?

Thanks,

Ernie D


Replies (1)

RE: Undoccumented fix for setting up fastcgi.server in config file - Added by gstrauss over 3 years ago

The "PHPRC" statement I found somewhere during my search did not help by itself.

That's because you misplaced it. The definition of PHPRC belongs in "bin-environment" if you desire it in the environment passed to the binary

    (1-1/1)