wilon / wilon.github.io

A simple notes show page.
https://wilon.github.io
34 stars 4 forks source link

BashOnWindows Nginx+PHP7.0,无法解析PHP文件 #9

Open wilon opened 7 years ago

wilon commented 7 years ago

修改配置文件

不要使用 sock 方式! nginx.conf

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;

                # With php7.0-cgi alone:
                fastcgi_pass 127.0.0.1:9000;

                # With php7.0-fpm: 
                # fastcgi_pass unix:/run/php/php7.0-fpm.sock; 
        }

php-fpm.conf

; listen = /run/php/php7.0-fpm.sock
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1

确保服务正常

service nginx start
service php7.0-fpm start