PHP COM application invisible

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hugh

    #1

    PHP COM application invisible

    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
    (http://www.php.net/manual/en/class.com.php). The example runs fine if
    I use PHP in command line, i.e., run it like: c:\php\>php
    c:\apache\apach e2\htdocs\comte st.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
    Hugh

  • Erwin Moller

    #2
    Re: PHP COM application invisible

    Hugh wrote:
    [color=blue]
    > 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
    > (http://www.php.net/manual/en/class.com.php). The example runs fine if
    > I use PHP in command line, i.e., run it like: c:\php\>php
    > c:\apache\apach e2\htdocs\comte st.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
    > Hugh[/color]

    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.

    Regards,
    Erwin Moller

    Comment

    • Chung Leong

      #3
      Re: PHP COM application invisible

      Did you give your Apache service access to the desktop?

      Comment

      • Hugh

        #4
        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
        Hugh

        Comment

        • Hugh

          #5
          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.

          Thanks
          Hugh

          Comment

          Working...