Reply to Re: exec php

Your name:

Reply:


Posted by Tom on 12/21/07 18:54

On Fri, 21 Dec 2007 05:01:05 -0800 (PST), warth33@hotmail.com wrote...
>
>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?


Since the exec() function isn't expecting anything back, it might be worth
trying either "shell_exec()" or "system()" since those would get back some
output from the program being accessed.

Tom
--
Newsguy Free Trial Accounts increased to 20 GB
http://newsguy.com/overview.htm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация