简体   繁体   中英

Running WordPress on Nginx Keeps Downloading File

I am trying to run Wordpress on my NGinx server, however I think that something is wrong because the index.php file keeps downloading rather than being run.

here is my sites-available:

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

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

    server_name your_domain.com;

    location / {
            # try_files $uri $uri/ =404;
            try_files $uri $uri/ /index.php?q=$uri&$args;
    }

    error_page 404 /404.html;

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

    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php7.1-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
    }
}

I checked to make sure that I had php7.1-fpm running and that my nginx was running as well. Both checked out to be just fine.

What am I missing?

Thanks

This link solved my problem. I was missing some packages that wordpress needed. After going through that guide everything worked

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM