file konfigurasi nginx dev.jaranguda.conf

server {
    listen       80;
    server_name  localhost;
    location / {
        root   /var/www/;
        index  index.html index.php;
    }
    location ~ \.php(?:$|/) {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        fastcgi_param modHeadersAvailable true;
        fastcgi_pass unix:/run/php/php7.1-fpm.sock;
        fastcgi_intercept_errors on;
    }
}

dengan konfigurasi diatas php masih menampilkan error “No input file specified.”

Error diatas muncul, karena location / tidak masuk dalam konfigurasi PHP-FPM dibagian location ~, solusinya sangat sederhana, pindahkan root lokasi folder anda ke atas atau dalam server {}, lengkapnya bisa dilihat dibawah

server {
    listen       80;
    server_name  localhost;
    root   /var/www/;
    location / {
        index  index.html index.php;
    }
    location ~ \.php(?:$|/) {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param HTTPS on;
        fastcgi_param modHeadersAvailable true;
        fastcgi_pass unix:/run/php/php7.1-fpm.sock;
        fastcgi_intercept_errors on;
    }
}

setelah melakukan perubahan diatas, restart nginx

systemctl restart nginx

Leave a comment

Your email address will not be published. Required fields are marked *