Quick little post on a problem I had while trying to use XHGui with my Nginx/PHP-FPM setup. I needed to be able to pass the auto_prepend_file and auto_append_file settings to PHP-FPM from Nginx. In apache you can declare multiple php_value settings. However, when I did the same in nginx, it would only reflect the second setting. Turns out you need to set all of your php_value’s in Nginx in a single string, and you separate them by new line characters. Here is how it should look:
location ~ .php$ { expires off; include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www//httpdocs/$fastcgi_script_name; fastcgi_param PHP_VALUE "auto_prepend_file=/var/www/xhprof/external/header.php n auto_append_file=/var/www/xhprof/external/footer.php"; }
1 thought on “PHP-FPM, Nginx, PHP_VALUE, and Multiple Values”