Additional Blogs by Members
Showing results for 
Search instead for 
Did you mean: 
Active Participant


Below I will show what are the steps to create the connection between PHP and SAP. This document seeks to have a guide for implementing the connection between PHP and SAP, for this example implementation is carried out on a linux server openSUSE 11.1, so that you can create a web application to access SAP online.

Installation of the library extension module for PHP SAPRFC

The installation of this extension is performed in the server PHP.


The installation was performed on a system with opensuse 11.1 of 32 bits. The installation of the library "extension module for PHP SAPRFC" was taking PHP Version 5.2.6 installed, Apache version 2.2.8 and Linux kernel i686.
The installation of the library will be done using the method of construction of the extension SAPRFC as a dynamic module without recompiling PHP.


To carry out the correct installation of the module require the following programs, except the SAP RFCSDK installing them is by yast:

  • Apache and php.
  • php-devel package for installation as a dynamic modulus saprfc
  • GNU tools (compat, autoconf, automake, flex, libtool, gcc, m4, make)
  • Non-Unicode SAP RFCSDK 6.20 for your platform here RFC_43-20000055_SDKLinux_on_IA32_32bit.SAR (this program is downloaded from low <Support Packages and Patches - My Company's Application Components SAP WEB AS - SAP WEB AS 6.20 - SAP RFC SDK>).
  1. SAPRFC download the library for PHP, which is in Sourceforge.
  2. Download the SAP RFCSDK from SAP, low <Support Packages and Patches - My Company's Application Components SAP WEB AS - SAP WEB AS 6.20 - SAP RFC SDK.
  3. Download the program from SAPCAR.
  4. Login as a superuser.
  5. Unzip RFCSDK SAP 6.20, with the command:   
    . /SAPCAR-xf-20000055_SDKLinux_on_IA32_32bit.SAR RFC_43
    This will create a folder called rfcsdk in the directory where the command was executed.
  6. Create the folder /usr/sap and there move the folder rfcsdk, thus being /usr/sap/rfcsdk.
    mkdir /usr/sap
    rfcsdk /usr/sap
  7. Give permissions to the directory created with the command   
    chmod-R 755 / usr / sap
  8. Unzip the sources of the library with the command saprfc
    tar-xvzf saprfc-1.4.1.tar.gz
  9. Run the following commands

    cd saprfc-1.4.1




    make install

    The commands generate dynamic php module called which to make 'make install' is copied to the folder where dynamic modules are loaded (/usr/lib/php5/extensions).
  10. In the folder /etc/php5/conf.d/ where are the configuration files of the modules to create the saprfc.ini with the following line:   
    extension =
  11. Restart Apache
    rcapache2 restart