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

I'm having this issue with Laravel which is served by nginx + php-fpm, it's just returning a blank page. Neither nginx nor php nor laravel are logging any errors at all.

When running the index.php with the cli it will return the welcome page.

The laravel stack is untouched, all error reporting/displaying/logging is turned on.

Below is my nginx vhost:

server {
    listen 801;
    server_name _;

    root /path/to/laravel/public;
    index index.html index.html index.php;

    charset utf-8;

    gzip                    on;
    gzip_http_version       1.1;
    gzip_disable            "MSIE [1-6].";
    gzip_vary               on;
    gzip_proxied            expired no-cache no-store private auth;
    gzip_comp_level         9;

    fastcgi_buffers         8 16k;
    fastcgi_buffer_size     32k;
    fastcgi_read_timeout    180;

    # serve static files directly
    location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
            access_log      off;
            expires         max;
    }

    location / {
            index  index.html index.htm index.php; #try static .html file first
            ##try_files $uri $uri/ /index.php;  <<Wrong!! this will break bundles like OneAuth for example
            try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    # catch all
    error_page      404 /index.php;

    #set client_max_body_size
    client_max_body_size 25m;
    #set client_body_buffer_size
    client_body_buffer_size 128k;

    location ~ \.php$ {
            fastcgi_split_path_info         ^(.+\.php)(/.+)$;
            fastcgi_pass                    unix:/var/run/php-fpm.sock;
            fastcgi_index                   index.php;
            fastcgi_param                   SCRIPT_FILENAME   $document_root$fastcgi_script_name;
            include                         fastcgi_params;
    }
}

My problem was that app/storage had the wrong permissions. So if you get the same errors as myself, blank page, try chmod 0777 the entire app/storage folder.

sudo chmod -R 0777 app/storage
share|improve this question
    
Did you try to log PHP error via configuration with FPM config catch_workers_output = yes option. just a reminder: you can use xtail for multiple log file such as xtail /var/log/* –  risyasin Nov 4 at 17:11

2 Answers 2

Try change your 'try_files' argument to the following:

try_files $uri $uri/ /index.php?$args;
share|improve this answer
    
Tried, but sadly no change. –  Raiu Jan 23 at 22:06
    
Have you definitely got 'display_errors' and 'error_reporting' set using php_admin_flag and php_admin_value in your PHP-FPM pool configuration? The Nginx configuration for Laravel is really quite basic, as long as you're not using a sub-directory. –  Jason Ilicic Jan 23 at 22:09
    
the phpinfo() returns: display_errors On, display_startup_errors On. So i guess it should be working –  Raiu Jan 23 at 22:10
    
Try setting these in your PHP-FPM pool configuration file: php_admin_flag[display_errors] = on (and) php_admin_value[error_reporting] = E_ALL (split them on their own lines, and remove the 'and'). Make sure you restart the 'php-fpm' service and then try again. –  Jason Ilicic Jan 23 at 22:11
    
Didnt help the reporting. This my current pool.conf file: pastebin.com/mc6P0PDy –  Raiu Jan 23 at 22:16

My problem was that app/storage had the wrong permissions. So if you get the same errors as myself, blank page, try chmod 0777 the entire app/storage folder.

sudo chmod -R 0777 app/storage
share|improve this answer

Your Answer

 
discard

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.