Last Updated: February 28, 2017
·
18.74K
· ramondelafuente

setting multiple PHP_VALUE in Nginx config

When you use Nginx and you want to set PHP settings inside a location block, you use fastcgi_param in combination with PHP_VALUE:

fastcgi_param PHP_VALUE "error_log=\"/path/to/logs/project-name.error\"";

But: you cannot add multiple PHP_VALUE lines, because each will overwrite the previous one:

fastcgi_param PHP_VALUE "error_log=\"/path/to/logs/project-name.error\"";

fastcgi_param PHP_VALUE "auto_prepend_file=\"/path/to/xhprof/header.php\"";

Instead, you must set all values in a single PHP_VALUE, spread over multiple lines:

fastcgi_param PHP_VALUE "error_log=\"/path/to/logs/project-name.error\"
auto_prepend_file=\"/path/to/xhprof/external/header.php\"";

1 Response
Add your response

Thanks a lot ...

over 1 year ago ·