You are here: Re: exec php « PHP Programming Language « IT news, forums, messages
Re: exec php

Posted by soldier.coder on 12/22/07 17:09

On Dec 21, 8:01 am, wart...@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?

First, what kind of program are you calling? Whats it do?
Second, please tell me you looked up Exec on the php.net site and read
all the comments made by folks who have done or attempted to do what
you are trying. The answer might be right there!
Third, what kind of resources does the called program use? Are you
running out of memory? are you running out of connections to a
database? What is your take on why the program is failing? What
permissions does the called program have? What permsissions does it
need?

 

Navigation:

[Reply to this 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

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