ID: 16075 Updated by: [EMAIL PROTECTED] -Summary: Logon fonction (usiong invoke) doesn't work in CGI, but in standalone Reported By: [EMAIL PROTECTED] -Status: Open +Status: Closed Bug Type: COM related Operating System: WinNT 4 PHP Version: 4.1.2 New Comment:
this seems to be a security issue. i suppose your apache server runs under a different user than you are running the cgi executeable. check if the user has enough rights to access the exchange server. Previous Comments: ------------------------------------------------------------------------ [2002-03-14 10:59:30] [EMAIL PROTECTED] Trying to access Exchange datas using COM objects, something matters, even if the code is well : impossible to logon on a MAPI Session. Configuration : NT 4, Apache 1.3.23, PHP 4.1.2 (but before too) in cgi mode. the code is : <? $instance = new COM("Mapi.Session") or die("Unable to instantiate Mapi.Session"); echo "Loaded Exchange, version ".$instance->Version."<br>"; $err=$instance->Logon("Pascal Guimier","",true,false); $inbox=$instance->Inbox; $collmsg=$inbox->Messages; $msg=$collmsg->GetFirst(); while ($msg) { print "Subject : ". $msg->Subject . "<br>"; $msg=$collmsg->GetNext(); } ?> And there is always an error message : "Warning: Invoke() failed: Une exception s'est produite. Source: Collaboration Data Objects Description: [Collaboration Data Objects - [MAPI_E_LOGON_FAILED(80040111)]] in d:\users\group\www\essais\com\mboxlist.php on line 5" "Une exception s'est produite" means there was an exception. So I tried in several manners, and what is troubling is that launching the script at command line (>php d:\users\group\www\essais\com\mboxlist.php) works well ! That's why I think the bug can be in COM invoke() function, that doesn't work the shame in two cases. But it's only a supposition. So now I only can use my scripts in cron to make a chache in order to fetch Exchange datas :o) Thanks Pascal ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16075&edit=1