dkperez Posted March 30, 2010 Share Posted March 30, 2010 I want to display images. LOCAL IMAGES. We can argue about all the reasons to "download the files from the server" and all the other extraneous stuff, but right now I need to know HOW to do this... In php I figure out what files should be in the show and create a file with the list. Irfanview has a command line option so it'll start up and display the local files. It looks like: c:\xampp\htdocs\i_view32.exe /slideshow=xxx.txt Open a Windows command window, put in the text, and it works PERFECTLY...... HOW do I do this from php? I found the "EXEC" command, and tried: $status=exec ("c:\xampp\htdocs\i_view32.exe /slideshow=xxx.txt"); and I get activity, but no Irfanview popping up and running... What DO I need to do to get this to work? Quote Link to comment https://forums.phpfreaks.com/topic/197008-how-do-i-run-a-windows-program-from-the-browser/ Share on other sites More sharing options...
premiso Posted March 30, 2010 Share Posted March 30, 2010 It may be that you are not escaping the slashes. $status=exec ("c:\\xampp\\htdocs\\i_view32.exe /slideshow=xxx.txt"); Give that a try and see if it yields some results. Just a note, this will only work on your server, if the server is on your local machine and that is what you want, it should work properly. Quote Link to comment https://forums.phpfreaks.com/topic/197008-how-do-i-run-a-windows-program-from-the-browser/#findComment-1034226 Share on other sites More sharing options...
shlumph Posted March 30, 2010 Share Posted March 30, 2010 Is PHP part of your path? Can you run PHP from the CL? ..nevermind, I don't think this matters. Quote Link to comment https://forums.phpfreaks.com/topic/197008-how-do-i-run-a-windows-program-from-the-browser/#findComment-1034232 Share on other sites More sharing options...
dkperez Posted March 31, 2010 Author Share Posted March 31, 2010 Tried the line, which is one I've tried before. I get the "loading" message and spinning indicator, but nothing ever comes up...... It doesn't get much simpler than this example, so what's going on? <?php $status=exec ("c:\\xampp\\htdocs\\i_view32.exe /slideshow=xxx.txt"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/197008-how-do-i-run-a-windows-program-from-the-browser/#findComment-1034739 Share on other sites More sharing options...
PFMaBiSmAd Posted March 31, 2010 Share Posted March 31, 2010 Without knowing what i_view32.exe does and what the expected results should be, best guess is that you need to go into the Apache service under the Windows service control panel and check the "Allow service to interact with desktop" checkbox and restart the Apache service. Quote Link to comment https://forums.phpfreaks.com/topic/197008-how-do-i-run-a-windows-program-from-the-browser/#findComment-1034750 Share on other sites More sharing options...
dkperez Posted April 3, 2010 Author Share Posted April 3, 2010 Let me switch to a (hopefully) more generic example: <?php $status=exec ("notepad.exe"); ?> which I PRESUME should just run notepad.... Unfortunately, you lost me with the "go into the Apache service under the Windows service control panel and check the "Allow service to interact with desktop" checkbox and restart the Apache service." I'm running xampp, so I'll have to figure out how to get into the Windows service control panel and all that.... Quote Link to comment https://forums.phpfreaks.com/topic/197008-how-do-i-run-a-windows-program-from-the-browser/#findComment-1036270 Share on other sites More sharing options...
dkperez Posted April 3, 2010 Author Share Posted April 3, 2010 OK, found the thing in services to tell Apache to interact with the desktop....... Shut everything down and restarted....... When I run the php, instead of getting a notepad window I just get "loading" and nothing happens....... What am I missing? Quote Link to comment https://forums.phpfreaks.com/topic/197008-how-do-i-run-a-windows-program-from-the-browser/#findComment-1036271 Share on other sites More sharing options...
shlumph Posted April 6, 2010 Share Posted April 6, 2010 You will probably have to type out the full path to Notepad.exe Quote Link to comment https://forums.phpfreaks.com/topic/197008-how-do-i-run-a-windows-program-from-the-browser/#findComment-1037783 Share on other sites More sharing options...
Mchl Posted April 6, 2010 Share Posted April 6, 2010 Just to clarify things: you're aware that this will open irfanview/notepad/whatever on your computer not on client's, aren't you? Quote Link to comment https://forums.phpfreaks.com/topic/197008-how-do-i-run-a-windows-program-from-the-browser/#findComment-1037786 Share on other sites More sharing options...
dkperez Posted April 13, 2010 Author Share Posted April 13, 2010 Can you elaborate on that? Isn't "my computer" the client? It's a single laptop that'll have the software running locally... So, again, still have the same problem.... Even WITH the full path I can't get Notepad or Irfanview or anything else to come up and run normally. Quote Link to comment https://forums.phpfreaks.com/topic/197008-how-do-i-run-a-windows-program-from-the-browser/#findComment-1040701 Share on other sites More sharing options...
Mchl Posted April 13, 2010 Share Posted April 13, 2010 The client is a computer that connects to your server to view pages on it. When your laptop is the only computer used to watch pages served by your laptop, then yes, your laptop is both a client and the server. Quote Link to comment https://forums.phpfreaks.com/topic/197008-how-do-i-run-a-windows-program-from-the-browser/#findComment-1040752 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.