Skip to Content

Problems to configure SAP NW RFC in PHP

Feb 14 at 07:58 PM


avatar image

Hello guys, I am to configuring the SAP NW RFC for PHP 5.6. I maked all necessary for this, so when I printing phpinfo at my server SAP NW RFC appears enabled but I having the next error to make a instance to sapnwrfc in a file PHP.

ERROR partner '30.123.321.111:sapms02' not reached TIME Wed Feb 14 19:29:09 2018 RELEASE 721 COMPONENT NI (network interface) VERSION 40 RC -10 MODULE nixxi.cpp LINE 3289 DETAIL NiPConnect2: 30.123.321.111:3300 SYSTEM CALL connect ERRNO 111 ERRNO TEXT Connection refused COUNTER 2

Script PHP:

use sapnwrfc;
use sapnwrfcConnectionException;
use sapnwrfcCallException;
 * Get some system informations
if (! extension_loaded('sapnwrfc')) {
    throw new \Exception('Extension "sapnwrfc" not loaded. Please see');
// @see the available connection paraemters here
$config = [
    'MSHOST' => '30.123.321.111',
    'CLIENT' => '500',
    'R3NAME' => '02',
    'CODEPAGE' => '1102',
    'user' => 'myuser',
    'passwd' => 'mypass'

try {
    $conn = new sapnwrfc($config);
} catch(sapnwrfcConnectionException $e){
    // do something!
 print $e->getMessage();
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Tibor Gerke Feb 14 at 10:20 PM

You mix up connection type "A" and "B", see link in your code.

Type "A" = _A_pplication server = "ASHOST", "SYSNR"

Type "B" = Message server (load _b_alancing) = "MSHOST", "R3NAME", "GROUP"

R3NAME is always three characters, SYSNR is number 00-99.

Your connection parameter should work with ASHOST and SYSNR.

$config =[
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thank you. But not I have the next message:
Could not instantiate converter from codepage 41030002 to codepage 1102. Function rscpCActivate failed with 2048


Ok, I am sorry, its work. I had to remove CODEPAGE'=>'1102'.