简体   繁体   中英

Connect PHP with SAP Database

So, I already followed all the steps below for saprfc windows 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 dircetory, 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.

Another source said we will we need SAP SDK. Is it really needed for Windows? Also, will it be possible to code PHP connect to SAP in a computer that doesn't have SAP program? Or we only can do those installations in computer that has SAP application?

Then after the installation, what do I have to do next? I am trying to do steps below, yet still confused....

  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
  6) Open project C:\PHP-x.y.z\ext\saprfc\saprfc.dsp in Microsoft Visual C++ 6.0
  7) 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)
  8) Set active configuration to "saprfc - Windows_TS" (under Build menu)
  9) Build php_saprfc.dll.
  10) Compiled DLL you find in C:\PHP-x.y.z\Release_TS directory

Where to get PHP sources, PHP win support, and how to compile the program?

Sorry, I am totally new to this. Looking for the answers. Thank you very much!

Building "windows extensions" is explained in general here: https://wiki.php.net/internals/windows/stepbystepbuild

There is also explained which version of VS you need for which PHP version.

I also tried to build the sapnwrfc extension for PHP 5.5 on windows, but failed at some part...my progress/documentation is here: https://github.com/piersharding/php-sapnwrfc/issues/6

Maybe you can progress further :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM