Search code examples
phpwindowsvisual-studio-2019saprfc

PHP 7.4.2 [extension] build errors on Windows


I am using a package (SAP RFC Connector) for some time now that is retrieved from here https://github.com/gkralik/php7-sapnwrfc

The package is working as expected on all PHP versions until 7.4.2 with source build.

I've built the php_sapnwrfc.dll from source with both VS2015 and VS2019 but I am unable to get it working due to these errors, that I am unable to solve.

For building, I've used this procedure:

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

Is there someone out there that knows how to solve this?

With VS2019 I got this error but no one knows what it means, especially the warning with the core number.

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

With VS2015 I got this error but this is due to compiler.

[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 version: 7.4.2 TS

Any help would be appreciated.


Solution

  • Someone got my problem solved, here is his reply.

    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).

    I can confirm that I tried building it with VS2015 and VS2019, not with VS2017.

    Thank you, the issue is solved.