Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: интерпретация переменн ых внутри PHP VALUE и PHP ADMIN VALU E для PHP-FPM
- To: nginx-ru@xxxxxxxxx
- Subject: Re: интерпретация переменн ых внутри PHP VALUE и PHP ADMIN VALU E для PHP-FPM
- From: "locojohn" <nginx-forum@xxxxxxxx>
- Date: Wed, 13 Jul 2011 12:12:23 -0400
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mickey.jlkhosting.com; s=x; h=Date:Sender:From:References:In-Reply-To:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To; bh=DbJkLV/R1bcYmP1ntWEbnUaUNG+UsoUI79H1kGRgkgo=; b=Jf+XYgNqOG6nSARd3WiZMzQjui7dlwFOSP/rX+bTiQJlzypdV+Juuj2rQ6+ib3JWl/BThwqUETYeqbYzk2ZMVuvSW7FJnriTpcQ/Fw/grwI9i+wEagimTQNswysQp6nB;
- In-reply-to: <87wrfm1b1e.wl%appa@xxxxxxxxxxx>
- References: <87wrfm1b1e.wl%appa@xxxxxxxxxxx>
Ant?nio P. P. Almeida Wrote:
-------------------------------------------------------
>
> location /fastcgi-test {
> fastcgi_pass phpcgi;
> }
how is phpcgi server node configured exactly?
> I'm having problems understanding how a PARAM type
> message can be sent
> from the upstream (fpm in this case) to the server
> so that we can use
> it's value on the config. I'm mostly ignorant
> regarding the details of
> FCGI implementations, particularly Nginx FCGI
> module, but I'm under
> the (perhaps erroneous) impression that the
> parameters are sent from
> the server to the upstream and are not sent back
> from the upstream to
> the server. Is it so?
PHP-FPM is a high performance interface to load php scripts in FastCGI
environment, aimed at busy sites with multiple virtual hosts; it
provides a number of useful options which are not available in other
FastCGI implementations. One of the extra options is actually support
for PHP_VALUE and PHP_ADMIN_VALUE special environment variables that
instruct PHP-FPM to alter PHP configuration before passing control to
the PHP script.
PHP-FPM receives control from the server (upon fastcgi_pass call),
prepares PHP runtime environment and loads the PHP script referenced by
the SCRIPT_FILENAME environment variable. As to parsing special
PHP_VALUE and PHP_ADMIN_VALUE environment variables, PHP-FPM allows
references to existing PHP configuration settings, that will be
substituted by the appropriate values, in the form of ${option_name}.
When it detects such variable reference in the PHP_VALUE or
PHP_ADMIN_VALUE environment string, it substitutes the ${option_name}
construct with the actual master (current) value of the specified PHP
variable (usually taken from php.ini).
As to the geo setting example provided, I think there was a mistake, and
this is why your script might have failed. Try:
geo $x {
default "include_path=${include_path}:/my/other/include/path";
}
fastcgi_pass $x;
or
geo $x {
default "${include_path}:/my/other/include/path";
}
fastcgi_pass "include_path=$x";
> As I understand it for the expansion of
> include_path to work there has to
> be another variable that contains its value as
> string so that it can be concatenated. Is it not?
Indeed, the variable is usually defined in the master php.ini file, or
other php.ini files that are loaded by default. Although, it was a bit
difficult to explain, I hope it still makes some sense!
Andrejs
Posted at Nginx Forum:
http://forum.nginx.org/read.php?21,212288,212340#msg-212340
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru
|