安装 PHP 时计算机错误中缺少 msvcr110.dll

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21397073/
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 04:07:12  来源:igfitidea点击:

msvcr110.dll is missing from computer error while installing PHP

phpdll

提问by Supereme

I am trying to install PHP(5.5). I extracted the zip file in C:\phpfolder. And I also set the 'Path' system variable to C:\php. But when I open command prompt and type phpI get error saying:

我正在尝试安装 PHP(5.5)。我在C:\php文件夹中解压缩了 zip 文件。我还将“路径”系统变量设置为C:\php. 但是当我打开命令提示符并键入时,php我收到错误消息:

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

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

I checked for this dll in C:\Windows\System32directory and I could locate the file there. How to get rid of this error? Any help would be appreciated.

我在C:\Windows\System32目录中检查了这个 dll ,我可以在那里找到该文件。如何摆脱这个错误?任何帮助,将不胜感激。

Thanks in Advance.

提前致谢。

回答by laurent

You need to install the Visual C++ libraries: http://www.microsoft.com/en-us/download/details.aspx?id=30679

您需要安装 Visual C++ 库:http: //www.microsoft.com/en-us/download/details.aspx?id=30679

As mentioned by Stuart McLaughlin, make sure you get the x86 version even if you use a 64-bits OS because PHP needs some 32-bit libraries.

正如 Stuart McLaughlin 所提到的,即使您使用 64 位操作系统,也要确保获得 x86 版本,因为 PHP 需要一些 32 位库。

回答by Marcin Orlowski

Since link to this question shows up on very top of returned results when you search for "php MSVCR110.dll" (not to mention it got 100k+ views and growing), here're some additional notes that you may find handy in your quest to solve MSVCR110.dll mistery...

由于当您搜索“php MSVCR110.dll”时,此问题的链接显示在返回结果的最顶部(更不用说它获得了 100k+ 的浏览量并且还在增长),这里有一些附加说明,您可能会发现这些说明在您寻求帮助时很方便解决MSVCR110.dll之谜...

The approach described in the answer is valid not only for MSVCR110.dll case but also applies when you are looking for other versions, like newer MSVCR71.dlland I updated the answer to include VC15 even it's beyond former scope.

答案中描述的方法不仅适用于 MSVCR110.dll 案例,而且适用于您正在寻找其他版本(如较新版本)时,MSVCR71.dll我更新了答案以包含 VC15,即使它超出了以前的范围。



On http://windows.php.net/you can read:

http://windows.php.net/ 上,您可以阅读:

VC9, VC11 and VC15

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

The VC9builds require you to have the Visual C++ Redistributable for Visual Studio 2008SP1 x86 or x64 installed.

The VC11builds require to have the Visual C++ Redistributable for Visual Studio 2012x86 or x64 installed.

The VC15builds require to have the Visual C++ Redistributable for Visual Studio 2015x86 or x64 installed.

VC9、VC11 和 VC15

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

VC9建立需要你有在Visual C ++可再发行的Visual Studio 2008安装SP1 x86或x64。

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

VC15建立需要有在Visual C ++可再发行的Visual Studio 2015年安装x86或x64。

This is quite crucial as you not only need to get Visual C++ Redistributable installed but you also need the right versionof it, and which one is right and correct, depends on what PHP build you are actually going to use. Pay attention to what version of PHP for Windows you are fetching, especially pay attention to this "VCxx" suffix, because if you install PHP that requires VC9 while having redistributables VC11 installed it is not going to work as run-time dependency is simply not fulfilled. Contrary to what some may think, you need exactlythe version required, as newer (higher) releases does NOTcover older (lower) versions. so i.e. VC11 is not providing VC9 compatibility. Also VC15 is neither fulfilling VC11 nor VC9 dependency. It is just VC15 and NOTHING ELSE. Deal with it :)

这非常重要,因为您不仅需要安装 Visual C++ Redistributable,而且还需要它的正确版本,哪个版本正确且正确,取决于您实际要使用的 PHP 版本。注意您正在获取的 Windows 版本的 PHP,尤其要注意这个“VCxx”后缀,因为如果您安装了需要 VC9 的 PHP,同时安装了可再发行组件 VC11,它将无法工作,因为运行时依赖根本不是满足。相反,有些可能会认为,你需要准确的版本要求,如新(更高)的版本不会覆盖旧的(降低)版本。所以即 VC11 不提供 VC9 兼容性。此外,VC15 既不满足 VC11 也不满足 VC9 依赖性。它只是 VC15 和没有别的。处理它:)

For example, archive name php-5.6.4-nts-Win32-VC11-x86tells us the following

例如,档案名称php-5.6.4-nts-Win32-VC11-x86告诉我们以下内容

enter image description here

在此处输入图片说明

  1. it provides PHP v5.6.4,
  2. PHP build is Non-Thread Safe (nts),
  3. it provides binaries for Windows (Win32),
  4. to run, Visual Studio 2012 redistributable (VC11) is required,
  5. binaries are 32-bit (x86),
  1. 它提供了 PHP v5.6.4,
  2. PHP构建是Ñ导通Ťhread小号AFE(NTS),
  3. 它为 Windows ( Win32)提供二进制文件,
  4. 要运行,需要 Visual Studio 2012 可再发行组件 ( VC11),
  5. 二进制文件是 32 位 ( x86),

Most searches I did lead to VC9of redistributables, so in case of constant failures to make thing works, if possible, try installing different PHP build, to see if you by any chance do not face mismatching versions.

我所做的大多数搜索都导致了可再发行组件的VC9,因此,如果经常无法正常工作,请尝试安装不同的 PHP 版本,看看您是否有任何机会不会遇到不匹配的版本。



Download links

下载链接

Note that you are using 32-bit version of PHP, so you need 32-bit redistributable (x86) even if your version of Windows is 64-bit!

请注意,您使用的是 32 位版本的 PHP,因此即使您的 Windows 版本是 64 位,您也需要 32 位可再发行组件 (x86)!

  • VC9: Visual C++ Redistributable for Visual Studio 2008: x86or x64
  • VC11: Visual C++ Redistributable for Visual Studio 2012: x86 or x64
  • VC15: Visual C++ Redistributable for Visual Studio 2015: x86 or x64
  • VC17: Visual C++ Redistributable for Visual Studio 2017: x86 or x64
  • VC9:适用于 Visual Studio 2008 的 Visual C++ Redistributable:x86x64
  • VC11:适用于 Visual Studio 2012 的 Visual C++ Redistributable:x86 或 x64
  • VC15:适用于 Visual Studio 2015 的 Visual C++ Redistributable:x86 或 x64
  • VC17:适用于 Visual Studio 2017 的 Visual C++ 可再发行组件:x86 或 x64

回答by adavea

I am on a 64 bit system, and I only got this to work after installing both the 32 and 64 bit versions of the redistributable. I did not try the 64 bit version by itself due to the other posters' warnings about using the 32 bit version (and am too lazy to uninstall the 32 bit version now that I have it working), so I don't know if the 32 bit version is needed or not in cases like mine.

我在 64 位系统上,只有在安装了 32 位和 64 位版本的可再发行组件后才能使用它。由于其他海报关于使用 32 位版本的警告,我没有单独尝试 64 位版本(并且现在我已经懒得卸载 32 位版本了),所以我不知道是否在像我这样的情况下是否需要 32 位版本。

回答by mateimcm

To identify which x86/x64 version of VC is needed:

要确定需要哪个 x86/x64 版本的 VC:

Go to IIS Manager > Handler Mappings > right click then Edit *.php path. In the "Executable (optional)" field note in which version of Program Files is the php-cgi.exe installed.

转到 IIS 管理器 > 处理程序映射 > 右键单击​​然后编辑 *.php 路径。在“可执行文件(可选)”字段中,请注意安装了 php-cgi.exe 的 Program Files 版本。

回答by Benjamin

I had installed PHP in IIS7 on Windows Server 2008 R2 using the Web Platform Installer. It did not work out of the box. I had to install the Visual C++ Redistributable for VS 2012 Update 4 (32bit) as found here http://www.microsoft.com/en-us/download/details.aspx?id=30679.

我已经使用 Web 平台安装程序在 Windows Server 2008 R2 上的 IIS7 中安装了 PHP。它没有开箱即用。我必须为 VS 2012 Update 4(32 位)安装 Visual C++ Redistributable,如http://www.microsoft.com/en-us/download/details.aspx?id=30679 所示

回答by captainhero70

I was missing the MSVCR110.dll. Which I corrected. I could run php from the command line but not the web server. Then I clicked on php-cgi.exe and it gave me the answer. The php5.dll was missing (I downloaded the wrong copy). So for my 2012 IIS box I re-installed using php's x86 non thread safe zip.

我错过了 MSVCR110.dll。我纠正了。我可以从命令行运行 php,但不能从 Web 服务器运行。然后我点击了 php-cgi.exe,它给了我答案。php5.dll 丢失(我下载了错误的副本)。因此,对于我的 2012 IIS 框,我使用 php 的 x86 非线程安全 zip 重新安装。