Welcome! Log In Create A New Profile

Advanced

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

July 13, 2011 05:57AM
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
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: 150
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready