Nginx + php-fpm always returns http 500

587

I am having a problem with my nginx (and php-fpm) virtual host configuration. The problem is all requests (except static files) return HTTP 500 (Internal Server Error)

Here is my nginx vh code

server {
    listen 80;

    root /var/www/somesite/public;
    index index.php index.html index.htm;

    server_name somesite.com;

    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/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

However when I serve using php's inbuilt development server everything works fine. FYI it's a laravel app

Thanks in advance

People are also looking for solutions to the problem: php - rhel7 php71 execution issue

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.