Below are the install instructions for Unix and Windows
- PHP sources (http://www.php.net/downloads.php)
- php-devel package for installation sapnwrfc as dynamic module
- GNU tools (autoconf, automake, flex, libtool, gcc, m4, make)
- Non-Unicode SAP RFCSDK 6.20 for your platform (see below)
If you are SAP customer you can download it from http://service.sap.com/swdc under <Support Packages and Patches - My Company's Application Components SAP WEB AS - SAP WEB AS 6.20 - SAP RFC SDK>)
You must obtain and install the NW RFC SDK from SAP for this extension to work. http://service.sap.com
Please follow OSS note 1056472, 1058327, 1236530
Extract source tarball to PHP source tree (under ext/ directory) and rebuild PHP with commands
rm ./configure
./buildconf --force
./configure --with-sapnwrfc=<path to nwrfcsdk> (+ your configuration directives)
make
Extract source tarball to some directory and build dynamic module with commands
cd <sapnwrfc dir>
phpize
./configure
./configure --with-sapnwrfc=<path to nwrfcsdk>
make
make install
Enable sapnwrfc extension editing your php.ini
extension = sapnwrfc.so
see also the example build.sh
- Get the
SAP NW RFC SDK
from http://service.sap.com. - Extract the SDK archive with SAPCAR
- Copy the
*.dll
files from thelib
folder to (just use the same like your PHP installation)- x86 (32bit): C:\Windows\system32
- x64 (64bit): C:\Windows\SysWOW64
- copy the right compiled version
php_sapnwrfc_*.dll
from builds to yourphp/ext
folder - active it in your
php.ini
(extension = php_sapnwrfc_*.dll)
NOTE: This is harder than you think :-)
- download SAP NW RFC SDK (i used 7.2.xxx)
- extract with SAPCAR.exe to C:\SAP\sapcar_x86\nwrfcsdk (for x64 C:\SAP\sapcar_x64\nwrfcsdk)
- get PHP "Development package (SDK to develop PHP extension)" http://windows.php.net/snapshots/
- install to C:\php-sdk\phpdev\vc11\x86\php-5.6.9-dev-devel-VC11-x86
- install VS2012 (can be express for free)
- create a new project (Visual C++ -> Win32 Project -> choose DLL -> choose empty project)
- add the files from
php-sapnwrfc
to the project (i thinkphp_sapnwrfc.h
andsapnwrfc.c
are enough, but i copied all)- also add them not just to folder, but to the header files!
- add c++ paths for *.h files
- C:\SAP\sapcar_x86\nwrfcsdk\include;
- C:\php-sdk\phpdev\vc11\x86\php-5.6.9-dev-devel-VC11-x86\include;
- C:\php-sdk\phpdev\vc11\x86\php-5.6.9-dev-devel-VC11-x86\include\Zend;
- C:\php-sdk\phpdev\vc11\x86\php-5.6.9-dev-devel-VC11-x86\include\win32;
- C:\php-sdk\phpdev\vc11\x86\php-5.6.9-dev-devel-VC11-x86\include\TSRM;
- C:\php-sdk\phpdev\vc11\x86\php-5.6.9-dev-devel-VC11-x86\include\sapi;
- C:\php-sdk\phpdev\vc11\x86\php-5.6.9-dev-devel-VC11-x86\include\main;
- Declare c++ preprocessors:
- PHP_WIN32
- ZEND_WIN32
- ZEND_DEBUG=0
- COMPILE_DL_SAPNWRFC
- _UNICODE
- UNICODE
- SAPwithUNICODE
- Linker add paths:
- C:\SAP\sapcar_x86\nwrfcsdk\lib
- C:\php-sdk\phpdev\vc11\x86\php-5.6.9-dev-devel-VC11-x86\lib
- Linker add:
- libsapucum.lib
- sapnwrfc.lib
- php5.lib