Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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


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;
share|improve this question
Have you tried pho.ini a google search brings up quite a few results, have have you found so far? –  Drew Khoury Nov 27 '13 at 13:15

1 Answer 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.

share|improve this answer
I think, also, that the spaces should not be there. –  Michael Hampton Nov 27 '13 at 17:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.