PHP 7.4.2 [扩展] 在 Windows 上构建错误

PHP 7.4.2 [extension] build errors on Windows

我使用一个包(SAP RFC 连接器)已经有一段时间了,它是从这里检索到的 https://github.com/gkralik/php7-sapnwrfc

包在所有 PHP 版本上按预期工作,直到 7.4.2 源代码构建。

我用 VS2015VS2019[=45 从源代码构建了 php_sapnwrfc.dll =] 但由于这些错误,我无法让它工作,我无法解决。

对于构建,我使用了这个过程:

  1. https://gkralik.github.io/php7-sapnwrfc/building.html#building-on-windows
  2. https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2

有没有人知道如何解决这个问题?

使用 VS2019 我得到了这个错误,但没有人知道这是什么意思,尤其是带有 核心编号的警告。

Warning: PHP Startup:
Can't load module 'C:/ownprograms/wamp/bin/php/php7.4.2/ext/php_sapnwrfc.dll' as it's linked with 14.24, but the core is linked with 14.16 in Unknown on line 0

使用 VS2015 我遇到了这个错误,但这是由于编译器造成的。

[17-Feb-2020 10:48:43 UTC] PHP Warning:  PHP Startup: sapnwrfc: Unable to initialize module
Module compiled with build ID=API20190902,TS,VS16
PHP    compiled with build ID=API20190902,TS,VC15
These options need to match

PHP版本:7.4.2 TS

如有任何帮助,我们将不胜感激。

有人解决了我的问题,这是他的回复。

Try with the attached DLLs. I've built it for both 7.4.2 and 7.4.3 with extension version 1.3.0, vc15, ts and x64. It should work. php_sapnwrfc.zip

For any PHP version > 7.2 except master branch you need to use VC15(Visual Studio 2017). I saw in your trace that you were using VC16 (Visual Studio 2019).

我可以确认我尝试使用 VS2015 和 VS2019 构建它,而不是使用 VS2017。

谢谢,问题已解决