亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

配置 php 后 nginx 失敗

配置 php 后 nginx 失敗

PHP
白衣非少年 2023-04-28 17:19:04
● nginx.service - A high performance web server and a reverse proxy server     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)     Active: failed (Result: exit-code) since Wed 2020-06-03 21:32:37 UTC; 17s ago       Docs: man:nginx(8)    Process: 3056 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=1/FAILURE)Jun 03 21:32:34 sal systemd[1]: Starting A high performance web server and a reverse proxy server...Jun 03 21:32:37 sal nginx[3056]: nginx: [emerg] "fastcgi_pass" directive is duplicate in /etc/nginx/sites-enabled/default:62Jun 03 21:32:37 sal nginx[3056]: nginx: configuration file /etc/nginx/nginx.conf test failedJun 03 21:32:37 sal systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILUREJun 03 21:32:37 sal systemd[1]: nginx.service: Failed with result 'exit-code'.Jun 03 21:32:37 sal systemd[1]: Failed to start A high performance web server and a reverse proxy server.配置文件    }    # pass PHP scripts to FastCGI server        #    location ~ \.php$ {        include snippets/fastcgi-php.conf;    #    #   # With php-fpm (or other unix sockets):        fastcgi_pass unix:/var/run/php/php7.4-fpm.socket;    #   # With php-cgi (or other tcp sockets):        fastcgi_pass 127.0.0.1:9000;    }
查看完整描述

1 回答

?
慕斯709654

TA貢獻1840條經驗 獲得超5個贊

很明確的告訴你,你不能重復使用fastcgi_pass。所以。


如果您使用 php 套接字,請這樣設置:


}

# pass PHP scripts to FastCGI server

location ~ \.php$ {

    include snippets/fastcgi-php.conf;

#   # With php-cgi (or other tcp sockets):

    fastcgi_pass 127.0.0.1:9000;

}

或者,如果您使用的是 unix 套接字,請將 fastcgi_pass 更改為:


}

# pass PHP scripts to FastCGI server

location ~ \.php$ {

    include snippets/fastcgi-php.conf;

#   # With php-fpm (or other unix sockets):

    fastcgi_pass unix:/var/run/php/php7.4-fpm.socket;

}


查看完整回答
反對 回復 2023-04-28
  • 1 回答
  • 0 關注
  • 221 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號