jsrosas
229
2
Servers

Centos7->Nginx->Laravel5.2

Posted 2 years ago by jsrosas

Hi all, I have an issue I cant figure out. I have CentOs7 installed with MariaDB, PHP5.6, Nginx 1.6.3. Nginx conf file looks like this:

server {
    listen       80;
    server_name  192.168.1.60;

    # Document Roo
    root   /usr/share/nginx/cybertrack/public;
    # Index
    index  index.php index.html index.htm;

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;

        fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

        fastcgi_max_temp_file_size 0;
        fastcgi_buffer_size 4K;
        fastcgi_buffers 64 4k;

        include        fastcgi_params;
    }
}

I have done all this commands mentioned in another post

sudo chown www-data:deploy <laravel_directory>/storage/logs/laravel.log
sudo chown root:deploy -h <laravel_directory>/.env
sudo chown www-data:deploy -R <laravel_directory>/bootstrap

php artisan key:generate
php artisan cache:clear
php artisan clear-compiled

But I always get 500 when I try the root index. I created a new route which just returns "ok"; and I see it working returning ok on the browser. But if I change that same new route to return a view('welcome') I get 500. The entire application folder is owned by nginx user and has drwxrwxr-x. permission. I also checked the resources folder just in case since the routes work but no view, and has the same permissions. I did all my chown's and chmod's with -R. What else can be wrong?

Please sign in or create an account to participate in this conversation.