Re: exec return values

From: Date: Fri, 04 Apr 2008 18:47:45 +0000
Subject: Re: exec return values
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-272542@lists.php.net to get a copy of this message
On Fri, Apr 4, 2008 at 11:34 AM, Philip Thompson <philthathril@gmail.com> wrote: > Is there a set list of return values/error codes returned by exec? I am > running this command on a windows box and getting the following error: > > exec ("net use /delete i: /y", $output, $ret); > print_r ($output); // Array() > echo "Return: $ret"; // Return: 2 The third parameter ($ret) isn't defined by the exec() function, but rather by the program called in the first parameter. I'm not certain if Windows has a[n easy] way to redirect STDERR to STDOUT, but if it does, try that. For example: <?php exec('./unix-application 2>&1',$ret,$err); print_r($ret); echo "Return: ".$err."\n"; ?> -- </Daniel P. Brown> Ask me about: Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo., and shared hosting starting @ $2.50/mo. Unmanaged, managed, and fully-managed!

« previous php.general (#272542) next »