[thelist] RE: PHP & COM on Windows

Ken Schaefer Ken at adOpenStatic.com
Wed Aug 3 19:51:18 CDT 2005


Hi,

I tried to hint that simply invoking an .exe from server-side script will not
make the application visible on the server's desktop due to the fact that
each security context (by default) has a completely separate session space
(including a separate desktop).

Without more information on what exactly you are doing (e.g. what accounts
you are running these various things under), and how you have configured
things (e.g. do you have a service set to interact with the interactive
desktop), it is impossible to say why notepad.exe is not visible. 

However, if I was a betting man, I would say that your PHP script is running
under <userA> (e.g. IUSR_<machinename> or LocalSystem or similar), and you
are logged in to the server console using <userB> and <userA> has a different
desktop to <userB> and hence notepad.exe is not visible. The process is
running (you can see it in Task Manager) but you can not interact with it
because the two desktops exist in completely different Windows sessions. And
that's good security architecture, otherwise a lower-privileged user would be
able to access/interact with the desktop of a higher privileged user, which
would be a nightmare to keep secure.

Cheers
Ken

: -----Original Message-----
: From: thelist-bounces at lists.evolt.org [mailto:thelist-
: bounces at lists.evolt.org] On Behalf Of Tim Massey
: Sent: Tuesday, 2 August 2005 5:44 PM
: To: thelist at lists.evolt.org
: Subject: [thelist] RE: PHP & COM on Windows
: 
: It's true I am triggering the PHP script from a web page - I have run
: some sample scripts in the same way and the application does become
: visible.
: 
: My objective is to develop a script/program which can read an attached
: CV, grab the contents of the document (doc, pdf, or whatever) and
: 'paste' the content into the database via an insert statement.
: 
: I also need to develop some form templating system to replace things
: like {comapany_name} in various documents and then print them out - like
: a mail merge.
: 
: Is there an easier way?
: 
: -----------------------------
: 
: 
: I'm starting to get into COM scripting from PHP and have come across an
: annoying issue. I can start an instance of notepad.exe but the app never
: gets focus or is visible on screen.
: 
: It definitely runs - and is seen in Task Manager - but I can not see it!
: I have tried the appactivate() method without success.
: 
: Does anyone know of a good reference sites to learn more about using COM
: from PHP?
: 
: Many thanks.
: 
: Tim.
: ------------------------------
: 
: 
: Message: 14
: 
: Are you running PHP as a webpage? If so, why do you expect notepad.exe
: to be visible to the interactive user? Unless you happen to be running
: your webpage in the same security context as your interactive logon
: -or- you enable that security context to interact with your desktop
: (only do that for privileged processes), then the two processes will
: have differing security contexts, and each context has it's own desktop.
: 
: Cheers
: Ken
: 
: 
: ------------------------------
: 
: 
: Message: 16
: 
: Yes. Perhaps the original poster misunderstood what COM is used for.
: It seems he's looking for a way for the client to launch notepad.exe.
: In which case he should looking for client-side ways of doing it.



More information about the thelist mailing list