star7th / showdoc

ShowDoc is a tool greatly applicable for an IT team to share documents online一个非常适合IT团队的在线API文档、技术文档工具
https://www.showdoc.com.cn
Other
12.26k stars 2.19k forks source link

PHP升级到8.2后启动报错 #2280

Closed Sylar-W closed 2 weeks ago

Sylar-W commented 2 weeks ago

抱歉作者,我又来请教了,因为之前的安全漏洞,所以升级了一下showdoc到php8.0.2nts

但是现在启动不了,因为我不懂PHP代码,研究了一下确实不知道哪里改错了,能否指点一下 image

image

报错信息: image

Sylar-W commented 2 weeks ago

仔细比对了一下7.3.4和8.0.2的php.ini,看了一下差异,应该装的依赖都有了,不确定为什么504..

这是nginx的报错

2024/10/26 23:48:54 [error] 5352#13156: 9891 CreateFile() "D:/wh/showdoc/phpstudy_pro/WWW/index.jsp" failed (2: The system cannot find the file specified), client: 10.6.220.1, server: localhost, request: "GET /index.js%70 HTTP/1.1", host: "xxx-CIS-test.xxx.com" 2024/10/26 23:48:54 [error] 5352#13156: 9898 CreateFile() "D:/wh/showdoc/phpstudy_pro/WWW/user_settings.cfg" failed (2: The system cannot find the file specified), client: 10.6.220.1, server: localhost, request: "GET /user_settings.cfg HTTP/1.1", host: "xxx-CIS-test.xxxg.com:9999" 2024/10/26 23:49:08 [error] 5352#13156: 9922 CreateFile() "D:/wh/showdoc/phpstudy_pro/WWW/rails_info/properties" failed (3: The system cannot find the path specified), client: 10.6.220.1, server: localhost, request: "GET /rails_info/properties HTTP/1.1", host: "xxx-CIS-test.xxx.com:9999" 2024/10/28 15:58:46 [error] 10432#9600: 1 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 10.8.168.86, server: localhost, request: "GET /web/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "10.6.22.5:9999" 2024/10/28 17:37:31 [error] 5524#688: 2 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 10.8.168.86, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "10.6.22.5:9999" 2024/10/28 17:42:23 [error] 5524#688: 6 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 10.8.168.86, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "10.6.22.5:9999" 2024/10/28 17:49:37 [error] 6488#8484: 2 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 10.8.168.86, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "10.6.22.5:9999" 2024/10/28 19:09:15 [error] 12284#3292: 2 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 10.8.168.86, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "10.6.22.5:9999" 2024/10/28 19:28:50 [error] 12284#3292: 6 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 10.8.168.86, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "10.6.22.5:9999" 2024/10/28 19:44:10 [error] 7868#3140: 1 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 10.8.168.86, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "10.6.22.5:9999" 2024/10/28 20:41:46 [error] 7868#3140: 6 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 10.8.168.86, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "10.6.22.5:9999" 2024/10/28 20:47:07 [error] 7868#3140: 9 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "localhost:9999" 2024/10/28 20:54:49 [error] 6552#12884: 1 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 10.8.168.86, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "10.6.22.5:9999" 2024/10/28 21:08:22 [error] 6552#12884: 5 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 10.8.168.86, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "10.6.22.5:9999" 2024/10/28 21:25:42 [error] 11568#10296: *1 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "localhost:9999"

star7th commented 2 weeks ago

这种报错应该是nginx跟php之间通讯不上,请求根本就没走到showdoc。 根据现有信息,我无法知道是什么原因

Sylar-W commented 2 weeks ago

仔细排查了一下 发现是VCRUNTIME的dll版本问题,目前已经修复了,

PHP Warning: 'C:\Windows\SYSTEM32\VCRUNTIME140.dll' 14.12 is not compatible with this PHP build linked with 14.28 in Unknown on line 0

这个警告信息指出,PHP 需要的 VCRUNTIME140.dll 版本与当前系统提供的版本不兼容。这通常发生在 PHP 依赖的 Visual C++ 运行时库版本与系统上安装的版本不匹配的情况下。以下是解决这个问题的步骤:

  1. 下载和安装正确版本的 Visual C++ 运行时 确认 PHP 需要的版本:

从 PHP 官方网站或 PHP 下载页面查看当前 PHP 版本所需要的 Visual C++ Redistributable 版本。PHP 8.0 及更高版本通常需要 Visual C++ Redistributable for Visual Studio 2015, 2017, 2019, and 2022。 下载适当的 Visual C++ Redistributable:

前往 Microsoft 下载中心。 下载与 PHP 版本兼容的 Visual C++ Redistributable 包。 通常,下载 vc_redist.x64.exe 或 vc_redist.x86.exe,具体取决于你的 PHP 是 64 位还是 32 位版本。 安装或修复: 如果已经安装,选择修复选项以确保所有文件都是最新的。 如果未安装,直接安装下载的可再发行组件。