Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP_VALUE in nginx.conf doesn't override parameters in php.ini

I have this location section in nginx.conf:

location ~ \.php {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param   PHP_VALUE   "memory_limit = 500M; post_max_size = 400M; upload_max_filesize = 300M";
            fastcgi_param SCRIPT_NAME $fastcgi_script_name;
            fastcgi_index index.php;
            fastcgi_pass 127.0.0.1:9000;
}

I need to increase these parameters for file downloading, but there're still previous values of php.ini in phpinfo()-list, despite updated $_SERVER['PHP_VALUE'] (contains values written by me in the config). I'd tried to change values in different ways: without semicolon, with \n, mixed both the previous variations, replaced PHP_VALUE with PHP_ADMIN_VALUE, copied the param from others' config; but it still was unsuccessful. Where's the problem? What obstruct to apply my params?

like image 494
vyenkv Avatar asked Sep 19 '25 20:09

vyenkv


1 Answers

For me, it worked in this format -

fastcgi_param PHP_VALUE "variable1=value1;\n variable2=value2; \n variable3=value3;";
like image 131
Rohan17 Avatar answered Sep 22 '25 10:09

Rohan17