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 05:57:55 -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=auxdNHja5n/9ZERuMVKUXpHlml4Lxs2jd7b35q+AXhE=; b=KForgnaOJ7iA2kUea/Y7iznxh4wgSN7dlXC2bqCID19vfU05PvHbODGqAkSbPtUV9GpXdNBLC+c/CU2jMCgsyCoCCv9CL5w2wpMDK7kK5U3wNmAaTx5Y+OAVe9pA6id0;
- In-reply-to: <87zkki24wh.wl%appa@xxxxxxxxxxx>
- References: <87zkki24wh.wl%appa@xxxxxxxxxxx>
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 mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru
|