简体   繁体   English

在Nginx上运行WordPress继续下载文件

[英]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. 我试图在NGinx服务器上运行Wordpress,但是我认为出了点问题,因为index.php文件一直在下载而不是在运行。

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. 我检查以确保已运行php7.1-fpm,并且我的nginx也正在运行。 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. 我缺少一些wordpress需要的软件包。 After going through that guide everything worked 通过该指南后,一切正常

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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