1、在 Windows 10 专业版中,PHP 无法运行的排查分析。执行命令:php-cgi.exe -b 127.0.0.1:9000-c C:/php-7.4.27/php.ini ,自动退出。如图1

2、安装 Visual C++ 2015运行库 64位,如图2

3、再次执行命令:php-cgi.exe -b 127.0.0.1:9000-c C:/php-7.4.27/php.ini ,报错:PHP Warning: ‘vcruntime140.dll’ 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0 。如图3

PS C:\php-7.4.27> php-cgi.exe -b 127.0.0.1:9000-c C:/php-7.4.27/php.ini
PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
PS C:\php-7.4.27>
4、重启电脑,仍然报同样的错误。参考网址:https://www.shuijingwanwq.com/2019/01/24/3139/ ,VC15 版本需要安装 Visual Studio 2017 x64 或 x86 的 Visual C ++ Redistributable,下载并安装 Microsoft Visual C++ Redistributable for Visual Studio 2017。安装 Visual CPP 2017运行库 64位。不再报错。如图4

PS C:\Windows\system32> php-cgi.exe -b 127.0.0.1:9000-c C:/php-7.4.27/php.ini
PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
PS C:\Windows\system32> php-cgi.exe -b 127.0.0.1:9000-c C:/php-7.4.27/php.ini
5、执行命令:php -v,正确显示 PHP 版本。如图5

PS C:\Windows\system32> php -v
PHP 7.4.27 (cli) (built: Dec 14 2021 19:52:13) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
PS C:\Windows\system32>
需要长期技术维护或远程问题排查?
我是拥有 15+ 年经验的 PHP / Go 后端工程师,长期关注已有系统维护、Bug 修复、性能优化、服务器排查、WordPress 网站维护和小功能迭代。
如果你的项目遇到以下情况,可以先从一次小问题排查开始合作:
- ✅ PHP / Laravel / Yii2 老项目无人维护
- ✅ Go / Gin 后端接口需要排查或优化
- ✅ WordPress 网站访问慢、报错或插件冲突
- ✅ Nginx / MySQL / Redis / Linux 服务器异常
- ✅ CDN / Cloudflare / DNS / HTTPS 配置问题
- ✅ 需要长期远程技术支持或兼职维护
更多介绍请查看:关于我 & 合作
微信:13980074657
邮箱:shuijingwanwq@gmail.com
Telegram:@shuijingwan
GitHub:https://github.com/shuijingwan
