繁体   English   中英

nginx下载php文件而不是执行它们(HHVM)

[英]nginx downloads php files instead of executing them (HHVM)

我正在尝试设置HHVM以执行我的PHP代码。 我使用的是Apache,但我切换到了Nginx,并且几乎可以正常使用了。 但是,当我尝试访问index.php ,它将下载文件而不是执行/提供文件。 这是我的配置,在配置并随后重新启动nginx服务之后,我运行了usr/share/hhvm/install_fastcgi

server {
        listen 80;
        listen [::]:80;

        root /var/www/domain.com/public_html;
        index index.php index.html index.htm;

        server_name domain.com www.domain.com;

        location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_index index.php;
            include fastcgi_params;
        }
}

有任何想法吗?

我修好了它。 我只需要包含hhvm.conf文件,然后执行try_files 这是我的新配置:

server {
    listen 80;
    listen [::]:80;

    root /var/www/domain.com/public_html;
    index index.php index.html index.htm;

    server_name domain.com www.domain.com;

    include hhvm.conf;

    location ~ \.php$ {
        try_files $uri $uri/ /index.php;
    }
}

暂无
暂无

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

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