Home » Php » PHP-fpm file not found error with laravel

PHP-fpm file not found error with laravel

Posted by: admin February 25, 2020 Leave a comment

Questions:

I’m trying to put a Laravel application on my server, so I took the base config from the laravel documentation and modified it to use the installed version of php and work with my reverse proxy. But i’m getting a blank page with just the words

File not found

php-fpm log

- -  15/Feb/2020:17:30:54 +0000 "GET /index.php" 404

My Nginx site config

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name events.grocock.email;

    include general/ssl.conf;
    include general/log.conf;

    root /root/events/public;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.html index.htm index.php;

    charset utf-8;

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

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_page 404 /index.php;

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

The contents of the public folder

drwxr-xr-x  5 www-data www-data 4096 Feb 15 20:23 ./
drwxr-xr-x 14 www-data www-data 4096 Feb 15 17:17 ../
drwxrwxr-x  5 www-data www-data 4096 Feb 13 13:59 css/
-rwxrwxr-x  1 www-data www-data    0 Feb  8 14:51 favicon.ico*
-rw-r--r--  1 www-data www-data  593 Feb  8 14:51 .htaccess
-rwxrwxr-x  1 www-data www-data 1842 Feb 15 17:11 index.php*
drwxrwxr-x  2 www-data www-data 4096 Feb 15 16:58 js/
-rwxrwxr-x  1 www-data www-data  377 Feb 15 16:58 mix-manifest.json*
-rwxrwxr-x  1 www-data www-data   24 Feb  8 14:51 robots.txt*
drwxrwxr-x  3 www-data www-data 4096 Feb 12 03:00 vendor/
-rwxrwxr-x  1 www-data www-data 1194 Feb  8 14:51 web.config*
How to&Answers: