cancel
Showing results for 
Search instead for 
Did you mean: 

PHP Connection String

Former Member
0 Kudos

Using below said code to connect with SBO with noluck, please help..

<?php

echo "SBO PHP TEST<br>";

$vCmp=new COM(SAPbobsCOM.company) or die ("No connection");

$vCmp->server = "(local)";

$vCmp->CompanyDB = "SBODemoIN";

$vCmp->username = "manager";

$vCmp->password = "1234";

$lRetCode = $vCmp->Connect;

echo $vCmp->CompanyName;

echo '<br>';

?>

This code is throwing following error:-

SBO PHP TEST

Fatal error: Class 'COM' not found in C:\inetpub\wwwroot\PHP\SAP\SBOtest.PHP on line 3

Accepted Solutions (1)

Accepted Solutions (1)

didier_bueno
Explorer
0 Kudos

As i said before, this error seems to be a PHP error, not SAP error. PHP can't find COM class because COM and DOTNET is no longer built into the php core and you have to add COM support in php.ini, check in your php.ini if you have this without the semicolon:


[PHP_COM_DOTNET]
extension=php_com_dotnet.dll

Former Member
0 Kudos

Thanks Bro..

Its really help.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Gaurav,

OS (32 or 34 bits) ?

Version of Business One (version and 32 or 64 bits)?

DI installed (32 or 64 bits) ?

Regards,

Eric

Former Member
0 Kudos

Hi Eirc,

Thanks for your interest, please find bleow my installation details:-

OS windows 7 32

SAP 8.81 PL11

DI 32 Bit 

Former Member
0 Kudos

Hi Gaurav,

Is the DI-API (32bits) installed on the same machine than the PHP server and is it accessible?

Regards,

Eric

Former Member
0 Kudos

Yes..

didier_bueno
Explorer
0 Kudos

Maybe you should add an include or require to the COM class, there's nothing that tells PHP where is that class.

Former Member
0 Kudos

Are you sure that the COM you are using is existing?