Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can PHP locally run an exe on a computer.

Status
Not open for further replies.

sclementshall

Technical User
Nov 2, 2006
8
US
I'm designing our customer portal, inside we store our customers computers and vnc information. Is there any way of having php locally (on the client side) run an exe (in our case vncviewer.exe.

I may have phrased that incorrectly since the client only sees html and javascript. Either way, I would appreciate any suggestions you may have.
 
No. A PHP app only runs on the server. It cannot invoke a program on the client machine.

JavaScript is deliberately designed to be sandboxed so that it cannot run external programs on the client side, either. You might be able to run a program on the client with client-side VBScript, but I do not know. I think you can do what you want through Java or ActiveX.

You will find that what you want to do is hard to do. This is by design -- a security feature to keep the client machine safer from hostile web code.


Want the best answers? Ask the best questions! TANSTAAFL!
 
I appreciate the response. I'm finding it very hard. What it boils down to is that I'm writing a client server app in php / mysql so that it will already be web ready. But I do understand the restrictions that are placed on web apps. I'll look into active x and java stuff.

Thanks,
 
But I do understand the restrictions that are placed on web apps.
If you can make a machine run an arbitrary program, so can anyone else. Which means any website that wanted to could run trojan horse programs, zombie botnet client software or any other kind of hostile software on any system.

That's how Microsoft got into so much hot water over ActiveX. It allowed to much leeway to too many people to do too much on systems without human intervention. And bad people exploited these security holes to do bad things to millions of computers.


Want the best answers? Ask the best questions! TANSTAAFL!
 
i think the OP could do something close to what he wanted with an hta file. essentially this would be a web application that was *installed* client side but still interacted with a remote server. an hta file is designed like any other javascript + html app but is run from the client-side. it has wide privileges on the system and so can fire off local programs and other scripts without an issue. similarly toolbars and other browser helpers can do the same thing. the wide privileges can also be used to update itself so, apart from the initial pain of downloading the starter app, the experience is the same as a web application. the server calls would typically be made with xmlhttprequest.

i don't know of the cross platform abilities of an hta file - i suspect, since they're more or less locked to internet explorer, cross-platform is not in the vocab: which may make a toolbar/helper approach more palatable if your design constraints include multi-platform/multi-broowser.

additionally php provides a GTK which again can be installed locally and interact remotely. i've never tried creating a client-side php app - i'd be interested to hear from anyone who has and what their feelings were about the GTK.

alternatively again ... an ajax intermediator like DeskRun might be what you are looking for.

and lastly (as a suggestion) you could develop entirely server side and use a framework like dojo to manage offline (client-side) data storage with dojo.storage. The learning curve into dojo is steep but if you just want to make use of single features then it's no more than an hour or so. I'm currently working on an easy way to detect online status and synchronise offline stored database edits (for example) with a server. Apart from getting the business rules right, the technical side is trivial - it's finding the time that's a problem!
 
Thanks jpadie,

An hta might be what I'm looking for.

I appreciate everyones response.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top