ptolomea Posted October 21, 2007 Share Posted October 21, 2007 got a problem with my exec() hanging, the code i had used to work but i changed the design and layout of my project and needed to run a different program with different parameters. I started writing the new stuff, got the the point where i can run a valid test and the script hangs, so i reverted to the old code that was working and it to hangs. after much research and looking around i found that each time i run the script the process shows up in the processes list in windows, and if i was to close the process the php page loads but the app never opens. my test page, just trying to get the app to open up, worry about the parameters later. <?php exec("mplayerc.exe") ?> i have also appended 2>&1 to the end to see if there was any errors, none, have tried <?php exec("mplayerc.exe",$responce); var_dump($responce); $responce always comes up empty when i kill the process from my list and tried as stated in php bug http://bugs.php.net/bug.php?id=22526 session_write_close() went to popen() as a test from reading http://bugs.php.net/bug.php?id=30794 and even tried shell_exec(), and system() with same results I have checked to make sure my safe_mode is off, i have seen mention of mod_php but have been unable to locate any reference to it in any of my config/extension files, I have also seen reference to switch from SAPI to CGI, I have not tried this, and its to late for me to figure out how to do so at the moment. the test system is running XP SP2, WAMP5(PHP5.2.2,APACHE2.2.4) -Thanks Quote Link to comment https://forums.phpfreaks.com/topic/74175-solved-exec-hanging/ Share on other sites More sharing options...
derwert Posted October 21, 2007 Share Posted October 21, 2007 exec is meant more for executing command line applications that will execute, do w/e it was meant to do then exit. What you are running is an application that's meant to be used through a GUI, so PHP executes the application and waits for it to exit; but since it's a GUI application it won't exit until you tell it to so PHP just sticks around waiting for it to exit. Quote Link to comment https://forums.phpfreaks.com/topic/74175-solved-exec-hanging/#findComment-374618 Share on other sites More sharing options...
ptolomea Posted October 21, 2007 Author Share Posted October 21, 2007 I figured it out, i remember about 3 weeks ago i crashed the entire install and was unable to recover it, had to reinstall and did not put a check in allow this service to interact with desktop, once i put that check there the app started up just fine Quote Link to comment https://forums.phpfreaks.com/topic/74175-solved-exec-hanging/#findComment-375026 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.