November 14, 2009 11:59AM
On Fri, 13 Nov 2009 14:22:55 +0100, Life Hunter wrote:

> I have setup PHP with spawn-fcgi, PHP work well, but how to pass custom
> settings to PHP per virtualhost ?
>
> Like this, for example (.htaccess get from RoundCube webmail) :
>
> "php_value upload_max_filesize 5M"

This works just fine:

location /somewhere {
fastcgi_param ENV_NAME "Value for Somewhere";
}
location /else {
fastcgi_param ENV_NAME "Value for somewhere else.";
}

If you are setting something that php doesn't read from its environment, just use ini_set() with $_SERVER or $_ENV. If the value you want isn't PHP_INI_ALL, there might be another way to get it in; too bad php-cgi environment usage seems undocumented in the manual.

I see no reason why this shouldn't work with a server block, too, for virtual host. Try also nginx's max request size parameters for your use case.

N.b., most/all fastcgi settings don't in if () {} blocks. That would be a feature request on my part, particularly to set different timeouts for GET and POST requests.
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: 50
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