Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/74175-solved-exec-hanging/
Share on other sites

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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/74175-solved-exec-hanging/#findComment-374618
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.