gkralik / php7-sapnwrfc

SAP NW RFC SDK extension for PHP 7.3+ & PHP 8
https://gkralik.github.io/php7-sapnwrfc
MIT License
88 stars 35 forks source link

Windows installation issues #37

Closed d4nyl0 closed 7 years ago

d4nyl0 commented 7 years ago

Hi,

Thank you for your time developing this project.

I have trouble installing pre-built module on PHP.

My configuration:

What happens: when I run php.exe I obtain "Warning: PHP Startup: Unable to load dynamic library '\xampp\php\ext\php_sapnwrfc.dll' - %1 is not a valid Win32 application".

I tried all DLLs (TS, NTS, x64, x86), but I have no success ever (with NTS DLL version error is different - of course).

Please, do you have any clue?

Regards Danilo

gkralik commented 7 years ago

@ThaDafinser any ideas? I've never tried to build or use it on Windows.

ThaDafinser commented 7 years ago

@d4nyl0 you downloaded the win32 version (of xampp)

xampp-portable-win32-7.0.16-0-VC14.7z

Can you do a php -v and check if PHP is also 32bit? The latest build are x64 only.

d4nyl0 commented 7 years ago

@ThaDafinser

php -v

PHP 7.0.16 (cli) (built: Feb 14 2017 12:08:37) ( ZTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies

In Windows Task Manager i can see "php.exe *32", which means it is 32 bit.

I though it was a 32/64 bit compatibility issue, but with php_sapnwrfc-1.0.0-7.0-vc14-ts-x86.dll I have same error.

ThaDafinser commented 7 years ago

@d4nyl0 AFAIR, those old version you are using worked with 32bit + NTS (not thread safe). (i never tested TS/ZTS, since i don't have such an enviroment).

Can you verify that SAP is 32bit as well? If i remember correctly at extraction level you can choose that as well. Maybe that is the issue.

Since you are using xampp, and not a simple php version: Does the phpinfo() show the SAP path as well? Maybe xampp do some special configuration.

Another thing: Since i'm currently only providing 64bit build, is there any reason to still use 32bit?

d4nyl0 commented 7 years ago

@ThaDafinser

I use xampp, but I can also run php executable :-) So in phpinfo() (or with php --info) I see "Thread Safe is enabled"; so I expected php_sapnwrfc-1.0.0-7.0-vc14-ts-x86.dll to work (7.0, VC14, TS, 32bit), but it isn't; always in phpinfo() I can see "C:\nwrfcsdk\lib" in "Path" section.

Can you verify that SAP is 32bit as well? If i remember correctly at extraction level you can choose that as well. Maybe that is the issue. I don't know; I extracted using SAPCAR tool (sapcar -xvf filename) and it asked nothing.

Maybe xampp do some special configuration. No special configuration; I use it in portable edition (links in previous post), so it builds all relative paths (not absolute) and I can move it among other machines changing nothing.

Another thing: Since i'm currently only providing 64bit build, is there any reason to still use 32bit? I use 32bit because there isn't XAMPP 64bit for Windows. :#) Ehi, I love Linux, but I have to do this job into a Windows environment. :-)

And... You found the problem! Using sapnwrfc.dll provided with SAP Gui 7.40 (\PRES1\GUI\WINDOWS\WIN32\System\ - I copied it in c:\nwrfcsdk\lib) the error is gone and module sapnwrfc (./php.exe -m | grep -i rfc).

So, as future reference, I'm using PHP 7.0.16 VC14 32bit, sapnwrfc.dll version 7420.221.24.38667 (found in SAP GUI 7.40 DVD) and php_sapnwrfc-1.0.0-7.0-vc14-ts-x86.dll.

Could it be OK? :-)

gkralik commented 7 years ago

Maybe we should include the sapnwrfc.dll version the prebuilt extensions are linked against on the release page...

@ThaDafinser what do you think?

gkralik commented 7 years ago

@d4nyl0 so your problem is solved then?

ThaDafinser commented 7 years ago

You mean adding the SAP version in the file name? Adding the dll dircetly is a license issue if im correct.

gkralik commented 7 years ago

Yes, only the version number, not the DLL itself.

On 11 May 2017 07:02, "Martin Keckeis" notifications@github.com wrote:

You mean adding the SAP version in the file name? Adding the dll dircetly is a license issue if im correct.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gkralik/php7-sapnwrfc/issues/37#issuecomment-300682892, or mute the thread https://github.com/notifications/unsubscribe-auth/AEuFN-olhYVL0ZVNJ1_npcJsZlS4ir6Vks5r4pZHgaJpZM4NVD9f .

ThaDafinser commented 7 years ago

Good idea. Will add it in the next bugfix release :+1:

d4nyl0 commented 7 years ago

@gkralik I have no more error/warnings, even though I had no time to test any connection. I think we can close this issue.

Ah, I have never compiled nothing under Windows, but I'm playing with Visual Studio, trying to build latest version of the library for x86. =8-O I'll keep you informed.

Thank you for support: can I offer a beer to you? ;-)

ThaDafinser commented 7 years ago

@d4nyl0 try the CLI - works better than the "GUI version" IMO. https://github.com/gkralik/php7-sapnwrfc/blob/master/docs/building.md#windows

d4nyl0 commented 7 years ago

@ThaDafinser I think so; PHP Wiki suggest to use CLI also. https://wiki.php.net/internals/windows/stepbystepbuild I'm lucky: I love CLI. ;-)

The only difference is that I'm using Visual Studio 2017 , the only available on the official page, but it has libraries for VC14 x86, so I couldn't encounter impossible issues. At least it is my hope. :-)

gkralik commented 7 years ago

Thank you for support: can I offer a beer to you? ;-)

You're welcome. You can ;-D

d4nyl0 commented 7 years ago

You're welcome. You can ;-D Ok, I did it. @ThaDafinser Are you abstemious? :-)

ThaDafinser commented 7 years ago

Beer is always nice ;-)

d4nyl0 commented 7 years ago

Ok, guys, you should already had received a beer (please, let me know if not) and I tested a first connection which works like a charm! :-) So, for me this issue could be closed.

Thanks a lot for your help. See you. Danilo

ThaDafinser commented 7 years ago

Ok, guys, you should already had received a beer (please, let me know if not)

Thanks a lot - tasted really well :beer: :smile:

gkralik commented 7 years ago

Thank you, it was very much appreciated ☺