Welcome! Log In Create A New Profile

Advanced

Re: Custom settings with PHP

July 12, 2011 09:47PM
Maxim Dounin Wrote:
-------------------------------------------------------

> geo $x {
> default
> "${include_path}:/my/other/include/path";
> }
>
> fastcgi_param PHP_VALUE $x;
>
> which relies on the fact that geo module doesn't
> support variables.
>
> No idea how php will handle this though, probably
> Antonio is right
> and this won't work anyway.

It works, just tested it with php-fpm. php-fpm substitutes ${var} with the value for "var" in the master .ini file (php.ini). So constructs like "${include_path}:/my/other/path" are OK to pass to the php-fpm environment, and these will be interpreted correctly. The only trouble is that the "geo" hack is kinda dirty indeed, especially so that all these variables have to be explicitly declared then in the http section, as the "geo" directive must be declared on the "http" level.

Antonio, I am certainly aware that one can write an auto_prepend_file PHP script that will set all these variables correctly, but I prefer to use server settings and skip auto_prepend_file overhead, if possible. Turns out it is possible on the php-fpm level, and not currently on the nginx level. Also, implementation of your suggestion means either changing the source code of the scripts on a number of sites and making it difficult to maintain/upgrade, or, as stated above, having auto_prepend_file overhead for every php call. No good and IMHO absolutely unnecessary and also pretty ugly, compared to what is possible with just passing the right string to the environment.

Let's wait for the nginx update!

Andrejs
Subject Author Posted

Custom settings with PHP

Life Hunter November 13, 2009 08:26AM

Re: Custom settings with PHP

Micha Glave November 13, 2009 09:06AM

Re: Custom settings with PHP

kyleb November 14, 2009 11:59AM

Re: Custom settings with PHP

mike November 14, 2009 12:36PM

Re: Custom settings with PHP

jbruni June 18, 2010 08:23AM

Re: Custom settings with PHP

Igor Sysoev June 18, 2010 08:36AM

Re: Custom settings with PHP

Jérôme Loyet June 18, 2010 09:06AM

Re: Custom settings with PHP

mike June 18, 2010 12:22PM

Re: Custom settings with PHP

Igor Sysoev June 18, 2010 12:26PM

Re: Custom settings with PHP

mike June 18, 2010 12:42PM

Re: Custom settings with PHP

Jérôme Loyet June 18, 2010 01:08PM

Re: Custom settings with PHP

mike June 18, 2010 02:00PM

Re: Custom settings with PHP

Jérôme Loyet June 18, 2010 02:18PM

Re: Custom settings with PHP

mike June 18, 2010 02:22PM

Re: Custom settings with PHP

locojohn July 09, 2011 06:59PM

Re: Custom settings with PHP

hobson42 July 12, 2011 09:42AM

Re: Custom settings with PHP

locojohn July 12, 2011 09:54AM

Re: Custom settings with PHP

António P. P. Almeida July 12, 2011 10:26AM

Re: Custom settings with PHP

António P. P. Almeida July 12, 2011 10:38AM

Re: Custom settings with PHP

locojohn July 12, 2011 10:40AM

Re: Custom settings with PHP

António P. P. Almeida July 12, 2011 11:02AM

Re: Custom settings with PHP

Maxim Dounin July 12, 2011 12:38PM

Re: Custom settings with PHP

locojohn July 12, 2011 09:47PM

Re: Custom settings with PHP

locojohn January 20, 2015 08:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 236
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready