S
S
soulrogi2014-12-09 06:59:22
PHP
soulrogi, 2014-12-09 06:59:22

How to assign a PHP.INI for each site or change its parameters through NGINX?

Good time everyone.)) On board is: nginx
+ php-fpm and two sites, one in CP1251 and the other
UTF
-
8

server{
fastcgi_param PHP_value 'mbstring.func_overload =2
mbstring.internal_encoding = UTF-8';
}

But it didn’t help ... ((
Tell me how you can implement it !?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
noway, 2016-02-07
@noway

In the nginx config, the PHP_VALUE parameters are needed via ; prescribe, rather than separate calls.
For example:

fastcgi_param PHP_VALUE "mbstring.func_overload = 2; mbstring.internal_encoding = UTF-8; max_input_vars = 10000; realpath_cache_size = 4096k";

V
Vitaly, 2014-12-09
@iamFake

in the php-fpm config for a specific host we write:
php_admin_value[mbstring.func_overload] = 2
php_admin_value[mbstring.internal_encoding] = UTF-8
as a result we get something like:

[some-host.tld]
listen = ...
...
php_admin_value[mbstring.func_overload] = 2
php_admin_value[mbstring.internal_encoding] = UTF-8

G
Gem, 2014-12-09
@Gem

You don’t need to look in the direction of nginx, but in the direction of php-fpm I’ll
try to briefly
nginx works only with static - it proxies dynamics
in the general case on php-fpm sometimes on apache (at least on ISS)
respectively - we make several backend instances on php-fpm with different settings
and in the configs of the nginx hosts we prescribe the necessary instances
. Questions?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question