简体   繁体   中英

missing Stack trace with Symfony2 Nginx and PHP-FPM

i recently switched from an Apache/fastCgi to a Nginx/FPM configuration. Everything workes fine so far, except the Symfony2 Stack trace.

When I use Nginx, I get the normal error output. When I use Apache, I get the beautified StackTrace output of Symfony2. My Developers starting to kick my ass because of the missing StackTrace. I have looked over every config file I could imagine (php.ini, vhost config, fpm config) and there does not seem to be an error. Probably some of you could give me a hint.

Nginx-Vhost Config:

    server {
    listen 80;
    root /var/www/mirco/htdocs/public/sp2/web;
    server_name api.sp2.mirco.esg.com;
    error_log /var/www/mirco/logs/error-sp_api.log;
    access_log /var/www/mirco/logs/access-sp_api.log;

    # strip api.php/ prefix if it is present
    rewrite ^/api\.php/?(.*)$ /$1 permanent;

    # remove trailing slashes
    rewrite ^/(.*)/$ /$1 permanent;

    location / {
        index api.php;
        try_files $uri @rewriteapp;
    }

    location @rewriteapp {
        rewrite ^(.*)$ /api.php/$1 last;
    }

    location ~ ^/(t|api|api_dev)\.php(/|$) {
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        fastcgi_pass unix:/var/run/php-fpm.mirco.sock;

        fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
        fastcgi_param  SYMFONY_ENV        api_mirco;
        include fastcgi_params;
    }
   }

Nginx-Main config

    user www-data;
  worker_processes 4;
  pid /var/run/nginx.pid;

  events {
        worker_connections 768;
        # multi_accept on;
  }

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 300;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;
        rewrite_log on;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # nginx-naxsi config
        ##
        # Uncomment it if you installed nginx-naxsi
        ##

        #include /etc/nginx/naxsi_core.rules;

        ##
        # nginx-passenger config
        ##
        # Uncomment it if you installed nginx-passenger
        ##

        #passenger_root /usr;
        #passenger_ruby /usr/bin/ruby;

  perl_modules perl/lib;

  perl_set $uri_lowercase 'sub {
  my $r = shift;
  my $uri = $r->uri;
  $uri = lc($uri);
  return $uri;
  }';

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}

Check this: http://wiki.nginx.org/Symfony

and potentially try to change this:

ini_set('display_errors', 'On');

better still change it in the php.ini

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM