| 
	
 | 
 Posted by warth33 on 12/21/07 13:01 
Hello 
 
I have a php site. Some page needs to call an external program. The 
programs are home made c# applications. 
 
It uses to  work without problem. For a while. Maybe it work for some 
hour. Or for a day. Or even for a week. 
 
At a certain point, when a php script calls the exe file, the 
application freezes. The following happens: 
 
<? 
   $return_value = exec('path_to_exe_file'); 
   echo $return_value; 
?> 
 
Well, the exec is executed (I can see that, the exe fil does what it 
has to do). But it doesnt return to the php-script. The php-script 
waits infinitely that the app will return, but it will not return. At 
a certain point the time execution exeedes. 
 
If I go to the command line and execute an exe file (the same one that 
exec calls), then it works without problem, and returns immediatly. 
But from the exec call it doesnt return. 
 
How do I solve this? Well, I restart the server. And hen everything 
works again. Which means that the script can use exec again without 
waiting infinitely. 
 
When the problems begin (when the exec begins to fail) the server can 
still work without problem. All the scripts run. The only scripts that 
dont run are those that have the exec call inside. 
 
error.log doesnt says anything about this. 
 
Im running apache 2.X on windows server 2003. PHP version is 5.x. 
 
I have put log function before and after every single call to exec. I 
analyzed it, but I can not understand why the exec fails. It only 
stops to get back the return value from the c# app. The c# app can 
also be a simple one with only a console.write (something like echo). 
But when exec has hanged up neither that will work. 
 
Someone can see the problem?
 
  
Navigation:
[Reply to this message] 
 |