Welcome! Log In Create A New Profile

Advanced

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

July 13, 2011 12:12PM
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
Subject Author Posted

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

Валентин Бартенев July 12, 2011 11:02AM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

locojohn July 12, 2011 11:58AM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

Maxim Dounin July 12, 2011 12:20PM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

Anonymous User July 12, 2011 12:38PM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

Anonymous User July 12, 2011 01:02PM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

Maxim Dounin July 12, 2011 01:54PM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

locojohn July 12, 2011 09:11PM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

Anonymous User July 13, 2011 12:16AM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

locojohn July 13, 2011 05:57AM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

António P. P. Almeida July 13, 2011 11:00AM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

locojohn July 13, 2011 12:12PM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

locojohn July 13, 2011 12:30PM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

António P. P. Almeida July 13, 2011 02:20PM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

António P. P. Almeida July 13, 2011 02:26PM

Re: интерпретация переменных внутри PHP VALUE и PHP ADMIN VALUE для PHP-FPM

locojohn July 15, 2011 06:59PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 118
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready