on 10-24-2014 8:50 PM
Hello,
I have the following problem;
...in DI API version 8.82 PL11 can usually connect via PHP:
$oComp = new COM("SAPbobsCOM.Company") or die("No connection");
$oComp->Server="IP\\INSTANCE";
$oComp->LicenseServer = "IP:Port";
$oComp->DbUserName = "user";
$oComp->DbPassword = "****";
$oComp->DBServerType = "7";
$oComp->UserName = "user";
$oComp->Password = "****";
$oComp->CompanyDB = "SBODemoUS";
try {
echo $oComp->Connect;
echo "<br><br>";
$oComp->StartTransaction();
} catch (com_exception $expt) {
echo $expt->getMessage();
echo "<br><br>" . $oComp->GetLastErrorDescription;
}
Note: MSSQL2012
In the case DI API 9.0 PL13 features the same connection the following error:
-119
Source: SAPbobsCOM.Company.90.0
Description: You are not connected to a company
Database server type not supported
Note: Both cases IIS environment
Hi Eric,
In addition to adding
[PHP_COM_DOTNET]
extension=php_com_dotnet.dll
to your php.ini file, you have to tell PHP where to look for the extension, and to enable extensions.
Where to look for extensions (Windows):
uncomment (remove the leading ";")
extension_dir = "ext"
<<<<<< OK up here!
Enable extensions:
Set the enable flag to On:
enable_dl = On
The problem was exactly the activation of this extension
Regards, Lucio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What kind of permission you applied?
What other settings you made in IIS environment?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Eric, In all the versions I'm being 5.3 to 5.6 have the same problem.
The version 8.82 is functioning normally in this environment - and the version 9 also worked in the old environment.
Not mentioned, but the old environment is W2k8 with the new environment and W2012.
The problem is not necessarily the SQL Server, but the native client or Windows itself. Because the version of the OS is 64bit - observe a small problem, but have not found the real problem.
hugs, Lucio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lucio,
I was able to make it work Under PHP 5.6.2.
My config. is:
My biggest issue was to make PHP to accept to instantiate a COM object, which was due to how I declared the extension in IIS, and it works both by forcing the processor model (32 or 64) of the CGI module from IIS.
In my code, I'm using exactly the same parameters as I do in other languages, so no DbUserName and all addresses are used as IP.
try {
$oComp = new COM("SAPbobsCOM.Company");
$oComp->Server = "192.168.90.118";
$oComp->LicenseServer = "192.168.90.118:30000";
$oComp->DBServerType = "6";
$oComp->UserName = "manager";
$oComp->Password = "Kuldip";
$oComp->CompanyDB = "DB_Test_Deli";
$return = $oComp->Connect;
if (0 == $return) {
echo "CompanyName: " . $oComp->CompanyName;
$oComp->Disconnect();
} else {
echo $return . "
" . $oComp->GetLastErrorCode . $oComp->GetLastErrorDescription;
}
} catch (com_exception $expt) {
echo "An error occured";
echo $expt->getMessage();
echo $oComp->GetLastErrorDescription;
} catch (exception $expt) {
echo $expt->getMessage();
}
Regards,
Eric
Yes, but with a named instance...
I don't remind which, but there is one of the components of the Platform which doesn't accept named instances. Not the same component, I know, but the issue is similar.
May you use the c:\windows\SysWOW64\cliconfg.exe program, to create a local alias to your instance, and in the server field, to use this alias instead of the IP-DNS\INSTANCE?
Regards,
Eric
Hi Lucio,
Since V9.0 in one case and 8.82 in the other: using 32 bits (with the corresponding DI-API) processes in both cases?
Regards,
Eric
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lucio,
Will do a test... But have to install PHP (not a usual config for me).
In the meantime, I have to learn how to read:
Regards,
Eric
Both errors (-119 and -226) are undocumented, but the fact of removing parameters indicates something which is different.
May you try to generate proxies from a VisualStudio (if needed, I can provide them) installation and use them insteat of referencing directly the COM objects?
Again, I have to read: DI not DIS, so definitively 7 and not the enum name,
Will definitively have to install PHP and do a test.
Regards,
Eric
Hi Lucio,
Fighting a bit to make PHP working on my VM...
In the meantime, was thinking: the data misalignment you had is (at least for me) a clear sign of a mismatch between the COM proxies you are using and the EXE which is calling them.
Since you are on DI 32 bits, what version of PHP are you using? a 64bits or a 32? In your case, it has to be a 32 bits version.
Regards,
Eric
Surprising about the IP, this is the only thing I am using: I just refuse to use DNS names, too many problems.
Anyway. WHat I've found in my research, is that you have to change the default Application Pool in IIS to let it accept 32 bits processes.
IIS / Application Pool, select the default (which should be associated to the default web site), then Extended properties on the top right menu, and change the property Accept 32 bits processes from false to true.
Then IISReset from a DOS box...
Regards,
Eric
Annoying...
You have installed:
When you force IIS to allow calling 32bits extensions it doesn't work and when you don't do it, you have a misallignment in memory (which is globaly a problem of calling convention).
You are sure to not have somewhere on this machine a 64 bits package of PHP which is called in place of the 32bits you installed?
Regards,
Eric
Sorry,I'm trying to understand.
SQL-Server is not the issue, else I would be really surprised.
I have read somewhere, that for fatsCGI and COM invocation, it was better to go down to PHP 5.3 and in all cases for a thread unsafe version.
Is it something you can try?
I'm having trouble to create COM objects from PHP to test your problem. Before I'm spending my night on it, do specific setting have to be put Inside the php.ini file?
Regards,
Eric
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.