Different PHP-configs in Nginx

I have a web-server running multiple server (virtual hosts) using nginx and fastcgi passing to a unix-socket.

What I want to accomplish is a set-up with beta.example.com and live.example.com, where the live site has error_reporting turned off (but still logs to file), and on the beta-site error_reporting is on.

So with Apache I would do something in the lines of:

<VirtualHost *:80>
    ServerName beta.example.com

    [...]

    php_flag display_errors on
    php_flag display_startup_errors on
    php_value error_reporting -1

    [...]
</VirtualHost>

When googling I haven't found anything where I can pass this kind of parameters to PHP using fastcgi. Does anyone know how to do this?

The configuration right now is (simplified):

server {
    server_name beta.example.com;
    [...]
    fastcgi_pass unix:/var/run/nginx/php-fastcgi.sock;
    fastcgi_index index.php;
}

Solution 1:

You can pass these options to PHP fastcgi from nginx with this syntax:

fastcgi_param PHP_FLAG "display_errors=on \n display_startup_errors=on";
fastcgi_param PHP_VALUE "error_reporting=-1";

Note the newline (\n) character that has to be between the passed options.