The installation of the
php7-sapnwrfc extension consists of three steps.
Installing the SAP NW RFC library
Compiling the PHP extension
Enabling the extension in your PHP configuration
Installing the SAP NW RFC library¶
You can find detailed instructions on how to compile, install and use the SAP NW RFC library on https://support.sap.com/en/product/connectors/nwrfcsdk.html.
The SAP NW RFC SDK is fully backwards compatible, supporting all NetWeaver systems, from today’s S4 down to R/3 release 4.6C. Using the latest version is recommended.
Changed in version 1.4.0: This extension only supports building for SAP NW RFC SDK 7.50.
Download the SAP NW RFC library¶
To download the SAP NW RFC library, go to the Software Center on the SAP ONE Support Launchpad.
SAP NW RFC SDK 7.50 in the search box. Then download the library version
that suits your platform.
If you don’t already have it, you also need the SAPCAR utility to extract the
library. You can also download it from the SAP Support Portal. Search for
Extract the library to a directory on your machine. This guide uses
/usr/sap/nwrfcsdk (on Linux) or
C:\nwrfcsdk (on Windows) as the
default path. You are free to choose another directory. If you do so,
make sure to substitute the correct path in the instructions below.
Configuring the library path¶
You have to configure your system to include the
lib directory of your
SAP NW RFC library installation in the library search path.
Create the file
/etc/ld.so.conf.d/nwrfcsdk.conf with following contents:
On a command prompt, execute
set PATH=%PATH%;C:\nwrfcsdk\lib. This is temporary
the change will be lost as soon as you close the command prompt.
The steps might differ depending on your version of Windows.
To permanently add the library to the PATH environment variable, follow these steps:
Open the Start menu and type
Edit the system environment variablesor
Edit environment variables for your account, depending on whether you want to set the path for the user or the whole system.
PATHenvironment variable, click
Editand add the path
Compiling the PHP extension¶
Follow the steps in Building from source to build the extension.
Enabling the extension¶
To enable the extension, add one of the following lines to your
# for Linux/Unix extension=sapnwrfc.so # for Windows extension=php_sapnwrfc.dll
You can verify that the extension is loaded by inspecting the output
php -m. It should contain a line