PHP 7:缺少 VCRUNTIME140.dll

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30811668/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 22:05:08  来源:igfitidea点击:

PHP 7: Missing VCRUNTIME140.dll

phpwindowsdllphp-7

提问by Félix Desjardins

I have an error when I start PHP 7 on Windows. When I run phpon the command line, it returns a message box with system error:

在 Windows 上启动 PHP 7 时出现错误。当我php在命令行上运行时,它返回一个带有系统错误的消息框:

The program can't start because VCRUNTIME140.dll is missing from your computer. Try reinstalling the program to fix this problem.

程序无法启动,因为您的计算机缺少 VCRUNTIME140.dll。尝试重新安装程序以解决此问题。

After that, CLIis crashing.

在那之后,CLI正在崩溃。

As I don't want to install a DLL file from an external website, I don't know how to fix this!

因为我不想从外部网站安装 DLL 文件,所以我不知道如何解决这个问题!

PHP version:7.0.0alpha1 VC14 x64 Thread Safe

PHP 版本:7.0.0alpha1 VC14 x64 线程安全

回答by Adam Cameron

On the side barof the PHP 7 alpha download page, it does say this:

边栏的的PHP 7阿尔法下载页面,它这样说:

VC9, VC11 & VC14 More recent versions of PHP are built with VC9, VC11 or VC14 (Visual Studio 2008, 2012 or 2015 compiler respectively) and include improvements in performance and stability.

  • The VC9 builds require you to have the Visual C++ Redistributable for Visual Studio 2008 SP1 x86or x64installed

  • The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64installed

  • The VC14 builds require to have the Visual C++ Redistributable for Visual Studio 2015 x86 or x64installed

VC9、VC11 和 VC14 较新版本的 PHP 是使用 VC9、VC11 或 VC14(分别是 Visual Studio 2008、2012 或 2015 编译器)构建的,并且包括性能和稳定性方面的改进。

  • 该VC9建立需要你有在Visual C ++可再发行的Visual Studio 2008 SP1的x86x64的安装

  • 该VC11建立需要有在Visual C ++可再发行的Visual Studio 2012 x86或x64安装

  • 该VCl 4建立需要有在Visual C ++可再发行的Visual Studio 2015年x86或x64安装

There's been a problem with some of those links, so the files are also available from Softpedia.

其中一些链接存在问题,因此也可以从Softpedia获得这些文件。

In the case of the PHP 7 alpha, it's the last option that's required.

在 PHP 7 alpha 的情况下,这是所需的最后一个选项。

I think that the placement of this information is poor, as it's kind of marginalized (i.e.: it's basically literally in the margin!) whereas it's actually critical for the software to run.

我认为这些信息的位置很差,因为它有点边缘化(即:它基本上就在边缘!)而它实际上对软件的运行至关重要。

I documented my experiences of getting PHP 7 alpha up and running on Windows 8.1 in PHP: getting PHP7 alpha running on Windows 8.1, and it covers some more symptoms that might crop up. They're out of scope for this question but might help other people.

我记录了我在 Windows 8.1 上用PHP启动和运行 PHP 7 alpha 的经验:让 PHP7 alpha 在 Windows 8.1 上运行,它涵盖了更多可能出现的症状。他们超出了这个问题的范围,但可能会帮助其他人。

Other symptom of this issue:

此问题的其他症状:

  • Apache not starting, claiming php7apache2_4.dllis missing despite it definitely being in place, and offering nothing else in any log.
  • php-cgi.exe - The FastCGI process exited unexpectedly(as per @ftexperts's comment below)
  • Apache 没有启动,php7apache2_4.dll尽管它确实到位,但声称丢失了,并且在任何日志中都没有提供任何其他内容。
  • php-cgi.exe - The FastCGI process exited unexpectedly(根据@ftexperts 下面的评论)

Attempted solution:

尝试的解决方案:

  • Using the php7apache2_4.dllfile from an earlier PHP 7 dev build. This did not work.
  • 使用php7apache2_4.dll早期 PHP 7 开发版本中的文件。这没有用。

(I include those for googleability.)

(我包括那些用于 googleability 的。)

回答by Thomas

Visual C++ Redistributable for Visual Studio 2015(x32 bit version) - RC.

适用于 Visual Studio 2015(x32 位版本)的Visual C++ Redistributable- RC。

This should correct that. You can google for what the DLL is, but that's not important.

这应该更正。你可以谷歌一下 DLL什么,但这并不重要。

PS: It's officially from Microsoft too:)

PS:它也是微软官方的:)

Where I found it: Downloads(Visual Studio)

我在哪里找到它:下载(Visual Studio)

回答by Prakash N

Installing vc_redist.x86.exeworks for me even though you have a 64-bit machine.

即使您使用的是 64 位机器,安装vc_redist.x86.exe对我也有效。

回答by Halcyon

If you've followed Adam's instructions and you're stillgetting this error make sure you've installed the right variants (x86 or x64).

如果您已按照 Adam 的说明进行操作,但仍然出现此错误,请确保您安装了正确的变体(x86 或 x64)。

I had VC14x64 with PHP7x86 and I still got this error. Changing PHP7 to x64 fixed it. It's easy to miss you accidentally installed the wrong version.

我有 VC14x64 和 PHP7x86,但仍然出现此错误。将 PHP7 更改为 x64 修复了它。很容易错过你不小心安装了错误的版本。

回答by Rust

For things like this, you don't blindly keep clicking 'Next', 'Next', and 'I Agree'.

对于这样的事情,您不要盲目地继续单击“下一步”、“下一步”和“我同意”。

WAMP informs you about this during and before installation:

WAMP 会在安装期间和安装之前通知您:

The MSVC runtime libraries VC9, VC10, VC11 are required for Wampserver 2.4, 2.5 and 3.0, even if you use only Apache and PHP versions with VC11. Runtimes VC13, VC14 is required for PHP 7 and Apache 2.4.17

VC9 Packages (Visual C++ 2008 SP1) http://www.microsoft.com/en-us/download/details.aspx?id=5582http://www.microsoft.com/en-us/download/details.aspx?id=2092

VC10 Packages (Visual C++ 2010 SP1) http://www.microsoft.com/en-us/download/details.aspx?id=8328http://www.microsoft.com/en-us/download/details.aspx?id=13523

VC11 Packages (Visual C++ 2012 Update 4) The two files VSU4\vcredist_x86.exe and VSU4\vcredist_x64.exe to be download are on the same page: http://www.microsoft.com/en-us/download/details.aspx?id=30679

VC13 Packages] (Visual C++ 2013[) The two files VSU4\vcredist_x86.exe and VSU4\vcredist_x64.exe to be download are on the same page: https://www.microsoft.com/en-us/download/details.aspx?id=40784

VC14 Packages (Visual C++ 2015) The two files vcredist_x86.exe and vcredist_x64.exe to be download are on the same page: http://www.microsoft.com/en-us/download/details.aspx?id=48145

You must install both 32 and 64bit versions, even if you do not use Wampserver 64 bit.

Wampserver 2.4、2.5 和 3.0 需要 MSVC 运行时库 VC9、VC10、VC11,即使您仅将 Apache 和 PHP 版本与 VC11 一起使用。PHP 7 和 Apache 2.4.17 需要运行时 VC13、VC14

VC9 包 (Visual C++ 2008 SP1) http://www.microsoft.com/en-us/download/details.aspx?id=5582 http://www.microsoft.com/en-us/download/details.aspx ?id=2092

VC10 包 (Visual C++ 2010 SP1) http://www.microsoft.com/en-us/download/details.aspx?id=8328 http://www.microsoft.com/en-us/download/details.aspx ?id=13523

VC11 Packages (Visual C++ 2012 Update 4) 要下载的两个文件 VSU4\vcredist_x86.exe 和 VSU4\vcredist_x64.exe 位于同一页面:http: //www.microsoft.com/en-us/download/details。 aspx?id=30679

VC13 Packages] (Visual C++ 2013[) 要下载的两个文件 VSU4\vcredist_x86.exe 和 VSU4\vcredist_x64.exe 位于同一页面:https: //www.microsoft.com/en-us/download/details。 aspx?id=40784

VC14 包 (Visual C++ 2015) 要下载的两个文件 vcredist_x86.exe 和 vcredist_x64.exe 在同一页面上:http: //www.microsoft.com/en-us/download/details.aspx?id=48145

您必须同时安装 32 位和 64 位版本,即使您不使用 Wampserver 64 位。

IMPORTANT NOTE: Be sure to to run all Microsoft Visual C++ installations with administrator privileges (right click → Run as Administrator). Just missing this small step wasted my entire day.

重要说明:确保以管理员权限运行所有 Microsoft Visual C++ 安装(右键单击 → 以管理员身份运行)。只是错过了这小步就浪费了我一整天的时间。

回答by Maq Said

I had same problem when installing Robot Framework 2.9.2 using the Windows installer version on Windows 7.

我在 Windows 7 上使用 Windows 安装程序版本安装 Robot Framework 2.9.2 时遇到了同样的问题。

I could solve it installing the VC14 builds require to have the "Visual C++ Redistributable for Visual Studio 2015 x86 or x64 installed" from Microsoft website.

我可以解决它安装 VC14 版本需要从Microsoft 网站安装“Visual C++ Redistributable for Visual Studio 2015 x86 或 x64” 。

回答by Nandkishor Gokhe

I got same error and found that myMicrosoft Visual C++ is 32 bit and Windows is 64 bit. I tried to install WAMP 7 32 bit and the problem was solved.

我遇到了同样的错误,发现我的Microsoft Visual C++ 是 32 位,而 Windows 是 64 位。我尝试安装 WAMP 7 32 位,问题解决了。

Maybe we need to install WAMP 32 bit if Visual Studio is 32 bit. And vice versa.

如果 Visual Studio 是 32 位,也许我们需要安装 WAMP 32 位。反之亦然。

回答by atlaste

Usually this is an error in your PHP configuration.

通常这是您的 PHP 配置中的错误。

It's actually pretty easy to figure out what exactly is going on:

实际上很容易弄清楚到底发生了什么:

  • Create a small file (test.php) with the standard phpinfo() script
  • Open a command prompt
  • Start php manually using the small file, e.g. '"\program files\php\php.exe" test.php
  • Read the error messages :-)
  • 使用标准 phpinfo() 脚本创建一个小文件 (test.php)
  • 打开命令提示符
  • 使用小文件手动启动php,例如'"\program files\php\php.exe" test.php
  • 阅读错误消息:-)