RE: [PHP-WIN] IIS and COM
| From: | Matthew Podwysocki | Date: | Mon, 21 Aug 2000 17:53:58 +0000 |
| Subject: | RE: [PHP-WIN] IIS and COM | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-1997@lists.php.net to get a copy of this message | ||
I am wondering if this is some NT thing. I have done ASP in the past and it seems to call the objects just fine. I have noticed however that I had 15 winword.exe's running in my process list without knowing it. I guess there is some strange permission I don't know about with IIS and COM. Can anyone help or has dealt with this in the past?
Matt Podwysocki
From: "PhiRo" <phiro@xs4all.nl> To: "Matthew Podwysocki" <gcprweb@hotmail.com> Subject: RE: [PHP-WIN] IIS and COM Date: Sat, 19 Aug 2000 12:02:41 +0200 Word objects turn into independent applications once created (This is by design as they say at microsoft :) ) . So if you do not explicitly call $word->Quit(); the process stays alive. That is a problem when the instance is not visible cause then you need to kill it from the task manager. You cannot kill a COM object instantiated by php while the php.exe is referencing it (So you need to wait until the process expires or the session is killed. Morals: Terminate all COM objects explicitly!!) Now the failure in adding new documents. Are you successful in executing other functions. Does the Word instance become visible when calling $word->Visible = 1? If this fails also you might like into the authorisations of the process. Normally NT will not allow objects to be started from a webproces (Though I have to admit I work with IIS and am not sure how Apache negotiates its authorisations with NT) Let me know, Cheers Philip. -----Original Message----- From: Matthew Podwysocki [mailto:gcprweb@hotmail.com] Sent: vrijdag 18 augustus 2000 21:24 To: andy.hoffman@bms.com; php-windows@lists.php.net Subject: Re: [PHP-WIN] IIS and COM On my phpinfo function call, I look into________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.comDirective Local Value Master Value allow_dcom Off Off typelib_file no value no valueI have found nothing in my php.ini that would seem to indicate COM settings. Is there something in that phpinfo that is of some use? I have tried the code you sent and I have the same message: Loaded word version (8.0b) Warning: Invoke() failed: No description available in \webroot\lib\comtest.php on line 21 It is the Documents->Add(); function that it seems to have a problem with. Thanks! Matt Podwysocki From: Andy Hoffman <andy.hoffman@bms.com> To: Matthew Podwysocki <gcprweb@hotmail.com>, php-windows@lists.php.net Subject: Re: [PHP-WIN] IIS and COM Date: Fri, 18 Aug 2000 14:50:38 -0400 Andy Hoffman wrote:com_invoke($word, "Document.Add"); com_invoke($word,"Documents[1].SaveAs","Usless_test.doc"); Mind you, I've never tried these, it's just a guess. Basing this onBASICinformation on php.net - the COM methods are not well documented.OK, I hate it when I'm wrong... but I was wrong. The "COM_invoke" method isn't working on my php4. Matthew, your code (with a properly installed php4) should work... try commenting out lines starting from the end of the script and work your way backwards... find out where the error is occuring. The following script executes on my machine (Apache/php4.0.2dev): <?php$word = new COM("word.application"); print "Loaded word version ($word->Version)\n"; $word->Visible = 1;$res = $word->Documents->Add();?> Of course, this isn't working PERFECTLY... while I don't get any php errors, the winword process that get's launched never terminates :( (can't even manually kill the process in task list under nt) Anyone else have more experience with the COM code??? -- Andy Hoffman Web Developer Bristol-Myers Squibb office: LVL G1.2607 email: andy.hoffman@bms.com phone: 609-252-5788 ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com