使用php7.0-fpm而不是php5-fpm为nginx

时间:2017-06-25 09:08:02

标签: php nginx

从php5.6更新到php7后,我将php5-fpm更新为php7.0-fpm。然后我改变了我的配置文件nginx,就是这样:

server {
    root /home/user/project/public_html/frontend/web;
    index index.php;
    server_name project-local;

    access_log /home/user/log/project.access.log ;
    error_log /home/user/log/project.error.log notice;

    location / {
            try_files $uri $uri/ /index.php?$query_string;
    }
    location @phpfpm {
            fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root/index.php;
    }
    location ~ \.php$ {
            fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
    }
}

我在日志文件中注意到使用了php5-fpm.socket,而不是php7.0-fpm.socket。这是一个错误日志文件:

[error] 2001#0: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1, server: project-local, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "project-local"

我试图关闭php5-fpm,但无论如何它都被使用了。

Somobody面临着一些问题?

0 个答案:

没有答案