How to connect SAP B1 9.0 or 9.1 with PHP 5.5.30?

1k views Asked by At

I have a problem related to SAP B1 and PHP 5.5.30 connection. Actually I know how I can connect PHP direct to SAP B1 Database but that is not good way of connection and it's not supported. So what I need to do is to connect PHP with SAP B1 but not direct connection. in order to read and write data in the SAP database. Here is code I tried to do but the result is 0, I do know the meaning of this 0.

    <?php
$mycomp = new COM("SAPbobsCOM.Company") or die("Cannot start SBO");
$mycomp->Server="192.168.0.103";
$mycomp->LicenseServer = "192.168.0.103:30000";
$mycomp->DbUserName = "sa";
$mycomp->DbPassword = "****";
$mycomp->UserName = "manager";
$mycomp->Password = "****";
?>

I have SQL server 2008, I use XAMPP for PHP and Adobe Dreamweaver for coding.

Please anyone can help me.

1

There are 1 answers

0
Overhed On BEST ANSWER

Result of 0 means you've connected to the company successfully.

I recommend that you review the SDK examples to get a better idea of how to interact with the DI API.

Also, you might want to investigate the use of the DI Server over the DI API. The DI API is a COM-based library that targets .NET. You may run into compatibility issues due to using PHP. The DI Server is basically a web service that wraps around the DI API and is much more friendly to all technology stacks.

Good luck.