Nginx stellt .php-Dateien als Downloads zur Verfügung, anstatt sie auszuführen

Ich installiere eine Website in einem Tröpfchen (Digital Ocean). Ich habe ein Problem bei der Installation von NGINX mit PHP. Ich habe ein Tutorialhttps: //www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-14-0 aber wenn ich versuche, eine .php-Datei auszuführen, wird sie nur heruntergeladen ... zum Beispiel ...http://5.101.99.123/info.php es funktioniert aber ... wenn ich zum main @ gehttp://5.101.99.123 es lädt meine index.php herunter: /

Irgendeine Idee

-rw-r--r--  1 agitar_user www-data   418 Jul 31 18:27 index.php
-rw-r--r--  1 agitar_user www-data    21 Aug 31 11:20 info.php

Meine / etc / nginx / sites-available / default

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

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

        # Make site accessible from http://localhost/
        server_name agitarycompartir.com;

               location ~ \.php$ {
                    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    #               # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    #
    #               # With php5-cgi alone:
    #               fastcgi_pass 127.0.0.1:9000;
    #               # With php5-fpm:
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
                    fastcgi_index index.php;
                    include fastcgi_params;
            }


              location / {

                    try_files $uri $uri/ =404;
                    # Uncomment to enable naxsi on this location
                    # include /etc/nginx/naxsi.rules
            }

... Andere "Ort" sind kommentiert (#)

Antworten auf die Frage(21)

Ihre Antwort auf die Frage