关键词搜索

源码搜索 ×
×

PhpStudy PHP8 网站打不开

发布2023-04-23浏览3308次

详情内容

第一种情况:502 bad gateway  静态网页能打开,php打不开

PhpStudy环境下,切换PHP8.0.2版本,发现网站打不开,变成502 bad gateway

但是静态网页是能打开的,就是PHP程序打不开

解决办法:

直接cmd到D:\phpstudy_pro\Extensions\php\php8.0.2nts这个位置执行php -v
如果发现出现以下错误PHP Warning: 'C:\Windows\SYSTEM32\VCRUNTIME140.dll' 14.0 is not compatible with this PHP build linked with 14.28 in Unknown on line 0

进入到这个网址https://www.yuque.com/u30882/rx39g7/kns2a2,咔咔已经将软件下载下来了,点击进去直接下载即可。

官网下载网址:下载 Visual Studio Tools - 免费安装 Windows、Mac、Linux

下载运行。搞定 

 下载:VC_redist.x64

或者直接下载

Microsoft Visual C++ Redistributable 2019
x86: https://aka.ms/vs/16/release/VC_redist.x86.exe
x64: https://aka.ms/vs/16/release/VC_redist.x64.exe

Microsoft Visual C++ Redistributable 2017
x86: https://go.microsoft.com/fwlink/?LinkId=746571
x64: https://go.microsoft.com/fwlink/?LinkId=746572

Microsoft Visual C++ Redistributable 2015
x86+x64: https://www.microsoft.com/en-pk/download/details.aspx?id=48145
x86+x64 update3: https://www.microsoft.com/en-us/download/details.aspx?id=53587

Microsoft Visual C++ Redistributable 2013
x86+x64 in all Language: https://support.microsoft.com/en-us/help/4032938/update-for-visual-c-2013-redistributable-package

Microsoft Visual C++ Redistributable 2012
x86+x64 in all Language: https://my.visualstudio.com/Downloads?pid=1452

Microsoft Visual C++ Redistributable 2010
x86-sp1: https://www.microsoft.com/en-pk/download/details.aspx?id=8328
x86-sp1-MFC-sec-update: https://www.microsoft.com/en-us/download/details.aspx?id=26999

第二种情况:

静态打不开,PHP也打不开,打开都是连接超时

偶尔打开其它其它一个域名,这个域名是线上正常的,我本地也设置了,正常情况下我本地打开这个域名是访问我本地的内容。发现打开是线上域名,所以找到原因,那就是本地hosts文件没有生效。

解决办法:

把hosts文件内容复制出来,来其他位置新建一个text文本文档,将内容复制进去,然后再添加上你需要的相关域名解析地址,保存为hosts文件。最后将修改的hosts文件覆盖掉windows 10默认的hosts文件,问题就得到解决。

hosts文件位置:C:\Windows\System32\drivers\etc

hosts文件没有后缀名。在Windows系统中,hosts文件的完整文件名为“hosts”,而不是“hosts.txt”或其他后缀

相关技术文章

点击QQ咨询
开通会员
返回顶部
×
微信扫码支付
微信扫码支付
确定支付下载
请使用微信描二维码支付
×

提示信息

×

选择支付方式

  • 微信支付
  • 支付宝付款
确定支付下载