You are here: Re: PHP exec function no output « PHP Programming Language « IT news, forums, messages
Re: PHP exec function no output

Posted by ZeldorBlat on 10/28/07 20:29

On Oct 28, 3:27 pm, "ryanm...@yahoo.com" <ryanm...@yahoo.com> wrote:
> I am running PHP 5.1.6 (cli) on Linux. When i use the exec($cmd,
> $output, $return) command the $output array is always blank if the
> command had an error in it. There are only values if the command was
> successful. How do I capture the error text returned?

There's a comment in the manual on exec() that explains this. Since
you couldn't find it (or didn't look) I'll paste it here.

$command = 'your command goes here';
$output = exec($command . ' 2>&1', $output, $return);

 

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

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