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

locojohn nginx-forum на nginx.us
Ср Июл 13 09:57:55 UTC 2011


Hi Appa,

For starters, which version of nginx and PHP are you using?   I am using
nginx 1.0.4 and PHP 5.3.6.

Next, in the nginx configuration I do:

http {

   [...]

   # geo directive must be set on the http level
   geo $x {
          default "${include_path}:/my/other/include/path";
   }

   [...]

}

then, in a virtual host configuration:

server {

    [...]

    # php-fpm upstream

    location ~ ^(?<SCRIPT_FILENAME>.+\.php)(?<PATH_INFO>[^?]*)$ {
         include /etc/nginx/fastcgi_params;

         fastcgi_param SCRIPT_FILENAME $document_root$SCRIPT_FILENAME;
         fastcgi_param PATH_INFO $PATH_INFO;
         fastcgi_param PATH_TRANSLATED $document_root$PATH_INFO;

         # set site-specific php configuration parameters
         fastcgi_param PHP_VALUE $x;

         if (-f $document_root$SCRIPT_FILENAME) {
            fastcgi_pass phpfarm;
         }

    }

Then I created a test.php file in the document root with the following
contents:

<?
     printf("include_path is: \"%s\"\n", get_include_path());
?>

And when calling the script, it outputs: 
".:/usr/share/php:/my/other/include/path", so it works for me.

Let's find out why it doesn't work for you?

Andrejs

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,212288,212327#msg-212327




Подробная информация о списке рассылки nginx-ru