Chirantha Posted May 29, 2007 Share Posted May 29, 2007 Hi, I want to lunch wmplayer and play a file on the server (my pc). I tried exec() and it didn't work. I'm guessing that it needs to create the window but the problem is how do I do it. What is the command to do it. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/ Share on other sites More sharing options...
trq Posted May 29, 2007 Share Posted May 29, 2007 I don't think you'll have much luck launching gui based applications through php (and server), what OS are you using? Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264274 Share on other sites More sharing options...
MadTechie Posted May 29, 2007 Share Posted May 29, 2007 I guess windows as his trying to run wmplayer "windows media player" try exec("start wmplayer.exe") Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264275 Share on other sites More sharing options...
per1os Posted May 29, 2007 Share Posted May 29, 2007 www.google.com google media player command line use the command line options for it. Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264277 Share on other sites More sharing options...
Chirantha Posted May 29, 2007 Author Share Posted May 29, 2007 well actually I need to run more programs than just media player.. such as a game.. I really need a way guys Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264280 Share on other sites More sharing options...
MadTechie Posted May 29, 2007 Share Posted May 29, 2007 *wonders if you tried my suggection* Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264288 Share on other sites More sharing options...
Chirantha Posted May 29, 2007 Author Share Posted May 29, 2007 I tried it.. it did something... but the wm player window didn't show up. Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264290 Share on other sites More sharing options...
MadTechie Posted May 29, 2007 Share Posted May 29, 2007 it may not of found media player try this Command Prompt exec("start cmd /p"); Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264294 Share on other sites More sharing options...
Chirantha Posted May 29, 2007 Author Share Posted May 29, 2007 didn't lauch the cmd.... Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264297 Share on other sites More sharing options...
MadTechie Posted May 29, 2007 Share Posted May 29, 2007 erm.. what about shell_exec (i really don't know this area too well, i never use them and i have a linux box as my server) Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264298 Share on other sites More sharing options...
Chirantha Posted May 29, 2007 Author Share Posted May 29, 2007 nope, didn't work. There MUST be away to do this Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264300 Share on other sites More sharing options...
MadTechie Posted May 29, 2007 Share Posted May 29, 2007 erm.. untill someone else posts a better suggestion i guess you could look here, also post a description of your setup. PHP version, OS, webserver+version.. Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264305 Share on other sites More sharing options...
trq Posted May 29, 2007 Share Posted May 29, 2007 It wont happen through a web server, but works fine through windows cli. If its through the server your looking for, your out of luck. Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264307 Share on other sites More sharing options...
Chirantha Posted May 29, 2007 Author Share Posted May 29, 2007 come on!!! yes it works when I double click it and run it. it just won't run via php... from my server.. come on.. isn't there an module or something? Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264318 Share on other sites More sharing options...
MadTechie Posted May 29, 2007 Share Posted May 29, 2007 CLI = Command Line Interface not double click the weird thing is you said when you used exec("start wmplayer.exe") is did something.. what exatly did it do ? (ie quick flash of a black screen) Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264322 Share on other sites More sharing options...
AndyB Posted May 29, 2007 Share Posted May 29, 2007 come on!!! yes it works when I double click it and run it. it just won't run via php... from my server.. come on.. isn't there an module or something? You want a php module that can launch an application on the client? Let's hope that's impossible, otherwise we're all doomed. Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264326 Share on other sites More sharing options...
MadTechie Posted May 29, 2007 Share Posted May 29, 2007 LOL Andy, if he said that i would hardly be helping trying to help I want to lunch wmplayer and play a file on the server (my pc) Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264333 Share on other sites More sharing options...
per1os Posted May 30, 2007 Share Posted May 30, 2007 Just to make sure the server is on the same pc that you are trying to open wmplayer from correct? Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264384 Share on other sites More sharing options...
Chirantha Posted May 30, 2007 Author Share Posted May 30, 2007 Guys. Here is something everyone can use to do what I wanted.. I made it in Freebasic. I call it the PHP external executer. It should work on Linux as the Shell command supports Linux. Download : http://csoft-p.no-ip.info/gm/exe.zip (7kb's). So, yay! I solved the problem my self. P.S. That Exe is Ccopyright © ChiranthaSoft. And oh.. the exe must be running for you to command it via the file. Just remember! *The File you CHECK IS DELETED AFTER ITS FOUND* Quote Link to comment https://forums.phpfreaks.com/topic/53470-lauch-an-program/#findComment-264422 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.