PHP COM application invisible

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi all,
I am having problem with COM objects in PHP. I am running PHP 4.4.1 on
apache server 2.0.55, on windows 2000.

I tried the first COM example in the PHP manual
( ). The example runs fine if
I use PHP in command line, i.e., run it like: c:\php\>php
c:\apache\apache2\htdocs\comtest.php, the word application starts and
after running the script, a word document is saved in the hard drive as
expected. But when I try to run it through web server, that is, type
http://localhost/comtest.php in the IE address bar, word application
run in background, and no file was saved at the end. It seems that
"$word->Visible = 1;" did not work in this case.

Any idea how to make the word application visible? Thanks.

Best regards

Re: PHP COM application invisible

Hugh wrote:

Quoted text here. Click to load it

Hi Hugh,

I think you are confusing client and server.
If you call some php-script and it instantiates a COM object, this is done  
on the server (apache et all), not on the client (webbrowser).

I expect the com WAS instantiated on the server, and maybe saved there too.
Check that.

If you need the wordapplication to run in the CLIENT (browser) you need a  
different approach, probably with javascript or VBscript.

Erwin Moller

Re: PHP COM application invisible

Did you give your Apache service access to the desktop?

Re: PHP COM application invisible

Hi Erwin and Chung,

Thank you for the replies.

I was checking the server PC for the word object, and it is invisible,
i.e., I can see a word process running in the "Task Manager", but no
file could be saved to the server PC.

I think the problem is most likely to be the access rights for Apache,
as mentioned by Chung Leong. Could you tell me how to give the Apache
service access to the desktop?

Thanks again

Re: PHP COM application invisible

Hi Chung,

Just did a search on this group and found your last year's post
regarding a similiar topic. Now the problem has been solved by ticking
the checkbox "Allow service to interact with desktop" in the property
page of the apache service and then restart the service.


Site Timeline