久久久久av_欧美日韩一区二区在线_国产精品三区四区_日韩中字在线

返回列表 發帖
查看: 2858|回復: 4

[求助] 單獨啟動nginx和phpcgi無法訪問UCenter

1

主題

6

回帖

13

積分

初學乍練

貢獻
0 點
金幣
6 個
樓主
發表于 2023-6-18 09:18:33 | 只看樓主 |倒序瀏覽 |閱讀模式
問題需求:
  1,點擊 站長 ==》UCenter設置 后,正常顯示通信成功
  2,window環境

問題描述:
  1,用apache 部署 -正常
  2,用phpstudy_pro 啟動nginx(會自動啟動 php-cgi) - 正常
  3,curl -X POST http://localhost/upload/uc_server/index.php?__times__=1 我嘗試用命令 竟然可以請求通。 - 正常
  3,手動啟動nginx 和 php-cgi.exe -b 127.0.0.1:9899 -c php.ini 后  - 連接不通,nginx提示錯誤如下:手動啟動的時候,都是在window環境下 以管理員的身份運行的。

  1.    2023/06/18 08:02:05 [error] 13016#24968: *4 WSARecv() failed (10054: An existing connection was forcibly closed by the remote host) while reading response header from upstream,     client: 127.0.0.1, server: localhost, request: "POST /upload/uc_server/index.php?__times__=1 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"
復制代碼


問題:
  1,求大佬指點,問題出在那里
我知道答案 回答被采納將會獲得1 貢獻 已有4人回答
回復

使用道具 舉報

1

主題

6

回帖

13

積分

初學乍練

貢獻
0 點
金幣
6 個
沙發
 樓主| 發表于 2023-6-18 09:25:24 | 只看Ta
nginx 配置 我覺得是沒問題的。

  1. server {
  2.         listen        80;
  3.         server_name  localhost;
  4.         root   "D:/app/Apache24/htdocs";
  5.         location / {
  6.             # index index.php index.html;
  7.             # First attempt to serve request as file, then
  8.             # as directory, then fall back to displaying a 404.
  9.             try_files $uri $uri/index.php /index.php?$query_string;
  10.             error_page 400 /error/400.html;
  11.             error_page 403 /error/403.html;
  12.             error_page 404 /error/404.html;
  13.             error_page 500 /error/500.html;
  14.             error_page 501 /error/501.html;
  15.             error_page 502 /error/502.html;
  16.             error_page 503 /error/503.html;
  17.             error_page 504 /error/504.html;
  18.             error_page 505 /error/505.html;
  19.             error_page 506 /error/506.html;
  20.             error_page 507 /error/507.html;
  21.             error_page 509 /error/509.html;
  22.             error_page 510 /error/510.html;
  23.             include D:/app/Apache24/htdocs/nginx.htaccess;
  24.             autoindex  off;
  25.         }
  26.         location ~ \.php(.*)$ {
  27.             fastcgi_pass   127.0.0.1:9000;
  28.             fastcgi_index  index.php;
  29.             fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
  30.             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  31.             fastcgi_param  PATH_INFO  $fastcgi_path_info;
  32.             fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
  33.             include        fastcgi_params;
  34.         }

  35.     }
復制代碼
回復

使用道具 舉報

1

主題

6

回帖

13

積分

初學乍練

貢獻
0 點
金幣
6 個
板凳
 樓主| 發表于 2023-6-18 14:54:10 | 只看Ta
已解決:送給需要的朋友:
1,問題的具體出錯點是:client.php 中的curl_exec方法
2,問題依據參考:http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_split_path_info
3,注意修改nginx的配置,具體如下:
  1.             fastcgi_split_path_info       ^(.+\.php)(.*)$;
  2.             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  3.             fastcgi_param PATH_INFO       $fastcgi_path_info/index.php;
復制代碼




回復

使用道具 舉報

8

主題

475

回帖

610

積分

應用開發者

貢獻
18 點
金幣
13 個
QQ
地板
發表于 2023-6-19 15:29:44 | 只看Ta
樓主,你的nginx用的是哪個版本的?印象中高版本的nginx都支持pathinfo的
回復

使用道具 舉報

1

主題

6

回帖

13

積分

初學乍練

貢獻
0 點
金幣
6 個
5#
 樓主| 發表于 2023-7-8 08:02:18 | 只看Ta
false001 發表于 2023-6-19 15:29
樓主,你的nginx用的是哪個版本的?印象中高版本的nginx都支持pathinfo的

用的是最新版本的3.5.x;  其實主要還是環境的問題用寶塔或者phpStudyPro 輕松可以搞定的。
只是我對其中的細節還想再琢磨一下
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

  • 關注公眾號
  • 有償服務微信
  • 有償服務QQ

手機版|小黑屋|Discuz! 官方交流社區 ( 皖ICP備16010102號 |皖公網安備34010302002376號 )|網站地圖|star

GMT+8, 2025-9-18 20:37 , Processed in 0.141534 second(s), 29 queries .

Powered by Discuz! W1.0 Licensed

Copyright © 2001-2025 Discuz! Team.

關燈 在本版發帖
有償服務QQ
有償服務微信
返回頂部
快速回復 返回頂部 返回列表