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: Fri, 15 Jul 2011 18:59:28 -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=NOVmDidJI/g9/26urCbhbm77TvQSSHQPG5W2J7A3eao=; b=QSoUnZONM2KTgfwSg+xS8D/+P1lRLG8IUbFh8+fgiYpCQzzg3isKbvokNvcDwUpNRlvMvLtDuR25WBsqKGVwq+mTFgU8OQyOc6Q2j+aJRIwwe+WR8pAcvi7iea95u+33;
- In-reply-to: <87sjqa11io.wl%appa@xxxxxxxxxxx>
- References: <87sjqa11io.wl%appa@xxxxxxxxxxx>
> > geo $y {
> > default "${precision}+1";
> > }
>
> - with fastcgi_param PHP_VALUE "precision=$x";
> + with fastcgi_param PHP_VALUE "precision=$y";
I do not think PHP-FPM can perform inline mathematical evaluation within
passed arguments to PHP_VALUE/PHP_ADMIN_VALUE. But it works for me
when it comes to generic substitution of existing and defined in the
master php.ini file configuration variables, with their actual values.
In my experience, Maxim's suggestion works fine, and I could so far
reference any variable I wanted in the PHP configuration file. This is
very useful, for example, if you want to set security limits with
open_basedir, but you also want to make sure that uploads work, but you
don't want to hardcode the temporary upload folder into open_basedir,
but rather read the current value from php.ini by adding
${upload_tmp_dir} to open_basedir value in the nginx configuration using
fastcgi_pass PHP_ADMIN_VALUE:
geo $upload_tmp_dir {
default "${upload_tmp_dir}";
}
...
fastcgi_pass PHP_ADMIN_VALUE
"open_basedir=$document_root:$upload_tmp_dir";
Anyway, it works for me.
Andrejs
Posted at Nginx Forum:
http://forum.nginx.org/read.php?21,212288,212473#msg-212473
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru
|