SAPRFC + PHP 5.2.10 + CentOS 5.4 64bit

Download following items :

  • re2c (yum install re2c)
  • SAPRFC, download here.
  • SAPCAR, download from SAP Service Support Portal  (Software Download > Support Packages and Patches > Additional Components > SAPCAR > SAPCAR 7.10 > Windows Server on x64 64bit). Download for Windows 64bit, this tool for extract SAR file.
  • Non-Unicode SAP RFCSDK 6.20 or 6.40, download from SAP Service Support Portal  (Software Download > Support Packages and Patches > Additional Components > SAP RFC SDK > SAP RFC SDK 6.40 > Linux on x86_64 64bit ). Extract using SAPCAR in Windows 64bit. Copy rfcsdk folder to Linux server.
  • librfc, download from SAP Service Support Portal  (Software Download > Support Packages and Patches > Additional Components > SAP Kernel > SAP Kernet 64-BIT > SAP KERNEL 6.40 64-BIT > Linux on x86_64 64bit > #Database independent). Extract using SAPCAR in Windows 64bit. Copy librfccm.so file to Linux Server.

* Extract SAR file using SAPCAR :
C:\>SAPCAR_[version].exe -xvf [SAR filename].sar

[[email protected] ~]# wget http://nchc.dl.sourceforge.net/project/saprfc/saprfc/1.4.1/saprfc-1.4.1.tar.gz
[[email protected] ~]# tar -zxf saprfc-1.4.1.tar.gz
[[email protected] ~]# cp -R saprfc-1.4.1 /usr/src
[[email protected] ~]# mkdir /opt/SAP
[[email protected] ~]# cp -R rfcsdk /opt/SAP/
[[email protected] ~]# cp librfccm.so /opt/SAP/rfcsdk/lib/
[[email protected] ~]# cd /usr/src/saprfc-1.4.1
[[email protected] saprfc-1.4.1]# export SAPRFC_DIR=/opt/SAP/rfcsdk/
[[email protected] saprfc-1.4.1]# export PATH=$SAPRFC_DIR/bin:$PATH
[[email protected] saprfc-1.4.1]# phpize
[[email protected] saprfc-1.4.1]# ./configure
[[email protected] saprfc-1.4.1]# make
[[email protected] saprfc-1.4.1]# make install
[[email protected] saprfc-1.4.1]# vi /etc/php.d/saprfc.ini (add this line -> extension=saprfc.so )
[[email protected] saprfc-1.4.1]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[[email protected] saprfc-1.4.1]# vi /var/www/html/test.php (add this line -> <?php phpinfo();?> )

Access file test.php from browser, if saprfc sucessfuly installed, in PHP info page saprfc module must shown as below.

SAPRFC + PHP 5.2.10 + CentOS 5.4 64bit