Manish Jangir
Manish Jangir

Reputation: 5437

How to install SAPRFC with PHP 5.4.4 in Windows 32 system?

I've tried a lot of things given over the internet to setup SAPRFC in Windows but they all are talking about PHP 5.2 version but everyone knows that we are using PHP 5.x nowadays.

I'm running Xampp server where my PHP version is 5.4.4 and I need to communicate with SAP server through PHP script. I've tried the procedure of copying librfc.dll in system32 folder and php_saprfc.dll in php/ext folder and also modification of php.ini but it doesn't help me.

I have followed these steps:

Installation:

  1. Extract zip file saprfc-$VERSION$-$PHP_VERSION$.zip
  2. Copy php-saprfc.dll to your extensions directory (e.g. C:\PHP\extensions)
  3. Edit php.ini file (in Windows system directory, e.g. C:\WINNT, C:\WINDOWS) and add line: extension=php_saprfc.dll
  4. Copy librfc32.dll (from SAPGUI install CD) to the Windows system directory or simple install SAPGUI on your machine.

Compilation:

  1. Extract php sources to C:\PHP-x.y.z

  2. Extract php win support files to C:\PHP-x.y.z\win32

  3. Install RFCSDK to C:\PHP-x.y.z\rfcsdk

  4. Copy SAPRFC sources to C:\PHP-x.y.z\ext\saprfc

  5. Copy php4ts.lib or php5ts.lib (from PHP binaries) to C:\PHP-x.y.z\win32

  6. For PHP5 copy saprfc.dsp5 to saprfc.dsp

  7. Open project C:\PHP-x.y.z\ext\saprfc\saprfc.dsp in Microsoft Visual C++ 6.

  8. Under Tools|Option|Directory set path for Include files and for Library files:

      (C:\PHP-x.y.z\win32\include; C:\PHP-x.y.z\rfcsdk\include;
       C:\PHP-x.y.z\win32\lib; C:\PHP-x.y.z\rfcsdk\lib)
    
  9. Set active configuration to "saprfc - Windows_TS" (under Build menu)

  10. Build php_saprfc.dll.

  11. Compiled DLL you find in C:\PHP-x.y.z\Release_TS directory

But I'm not getting the compilation part.

Upvotes: 1

Views: 3189

Answers (2)

Jiri Novak
Jiri Novak

Reputation: 11

You can download precompiled version here: https://sourceforge.net/projects/saprfcsapnwrfc/files/

Upvotes: 0

Markus Müller
Markus Müller

Reputation: 2641

The newest version is from 2009 and can be found here. For newer PHP versions you have to compile the extension yourself (at least the docs say so). Seems like the devs didn't make the jump to the newer versions because of the compiler needed. In the compilation docs it still says Microsoft Visual C++ 6.0. AFAIK modern PHP uses 9.0. So you propably need to tinker a bit with it. Or you might ask in the SAP forums if someone did the necessary work already.

Upvotes: 0

Related Questions