Closed FlorinProfeanu closed 4 months ago
See Connecting to a SAP System, specifically the link to the sapnwrfc.ini parameters.
Hello,
I am trying to see if the setup pf ini file works also when using ashost. Then I will see how to manage balancing server.
This works: $config = [ 'ashost' => 'my_host', 'sysnr' => 'my_sysnr', 'client' => 'my_client', 'user' => 'my_user', 'passwd' => 'my_password', ]; $sapConnection = new SapConnection($config)
So I created a sapnwrfc.ini in the same folder with my PHP script: ASHOST=my_host SYSNR=my_sysnr CLIENT=my_client USER=my_user PASSWD=my_password
Then I do this: SAPNWRFC\Connection::setIniPath("sapnwrfc.ini");
The question is: how I write this when using ini file? $sapConnection = new SapConnection(????);
I want also to mention that the call to setIniPath does not fail, even if the file name mentioned as parameter does not exist.
Florin
SAPNWRFC\Connection::setIniPath()
takes a path where the SDK searches for the INI file, not the path to the file itself. It will not error if the path or file does not exist, simply because the SDK itself does not seem to care.DEST
parameter (see below):DEST=test
ASHOST=<YOUR_HOST>
SYSNR=00
CLIENT=<YOUR_CLIENT<
USER=<USER>
PASSWD=<PWD>
TRACE=0
<?php
SAPNWRFC\Connection::setIniPath(__DIR__); // for an INI file in the same directory as the script
$connection = new SAPNWRFC\Connection([ 'DEST' => 'test']);
// Do stuff here...
I made a not to improve the documentation and provide an example.
The call SAPNWRFC\Connection::setIniPath(DIR) saved the day, thank you so much. Now is all good, including using MSHOST for balancing server. MSSERV was not needed in my case.
Hello,
Is it possible to connect to a message server (Load Balancing)?
Florin