Hello, recently I started working on a PHP application that is going to extract data from SAP and searching the Web I found the SAPRFC extension. So my problem came when I tried to configure the extension to work. The documentation that comes with the file is too vague and reading online I didn't a solution that worked. So after getting it to work, I decided to create a guide for any other person that is having the same problem I had.
Software Needed
- Wampserver v2.1e - I used Wampserver since it more easy to configure and it has a neat tray icon that it's really usefull. (Download)
- Wampserver PHP Addon - For SAPRFC to work you need a specific version of PHP. For me, 5.2.8 was the one that worked (Download)
- Wampserver APACHE Addon - Same thing goes for APACHE, you need an specific version. I used 2.0.54. (Download)
- SAPRFC - Download the latest one (Download)
- And lastly, you need to have the librfc32.dll file on your c:/Windows/System32/ folder. This file is copied by SAPGUI when you install it, so I recommend you do that. Install SAPGUI.
OS Enviroment
- This worked for me on Windows XP, 7 and 8.
Installation Steps
- Install Wampserver. The install the PHP Addon and the APACHE addon. The installation process is pretty straight foward, so after everything is installed you have to activate the APACHE and PHP version that we're going to use. Left click on the Wampserver tray icon and in Apache->Version select 2.0.54, wait for the service to restart then in PHP->Version select 5.2.8. Go to localhost in your browser and check that the version in APACHE and PHP are selected.
- Open the SAPRFC zip file and copy the file php_saprfc_528.dll and place it in C:\wamp\bin\php\php5.2.8\ext. Change the name to php_saprfc.dll.
- Left click on the Wampserver tray icon and PHP->php.ini to edit the PHP configuration file and add the following line extension=php_saprfc.dll, save and close the file. Then left click on Restart All Services.
- And if everything went well you should see in your localhost page the saprfc extension loaded. If not, check your apache error log file to see any error.
So hope this worked for me and I hope it works for you. If you know a better way of doing this, please share. Good luck and happy programming!!