exec(...unzip...) -- probs, not getting errors

From: Date: Thu, 03 Aug 2000 14:01:07 +0000
Subject: exec(...unzip...) -- probs, not getting errors
Groups: php.general 
Request: Send a blank email to php-general+get-9930@lists.php.net to get a copy of this message
Hi Cannot get exec(...unzip...) to work on a FreeBSD4.0/Apache1.3.12/mod_PHP4.0.0 system -- register_globals on, track_vars on, track_errors on, display_errors on. -- all file/dir perms set to 777 for testing. The "$command" string works from command line, but using it in the exec() function does not work -- so I'm trying to find errors generated by the PHP exec() command -- code follows. Any ideas (a) getting the exec to work, or (b) getting errors for diagnosis? TIA, Tom --------------------------------------------------------- // === the following DOES WORK from the command line $command="/usr/local/bin/unzip -oq /usr/local/etc/httpd/htdocs/webpages/tester/my3rdtry.zip"; exec($command,$returnedarray,$returnedval); // trying any/everything to find an error message echo "<HR>\$php_errormsg is <b>".$php_errormsg."</b><hr>"; echo "<HR>GLOBAL [php_errormsg] is <b>".$GLOBAL['php_errormsg']."</b><hr>"; echo "<hr>We have tried to <b>unzip</b> the <b>$filetounzip</b> file". "<P>gettype(\$returnedval) is <b>".gettype($returnedval)."</b><P>". "<P>gettype(\$returnedarray) is <b>".gettype($returnedarray)."</b><P>". "<P>We received error messages: "; if(gettype($returnedarray)=="array"){ echo "<P> \$returnedarray is _<b>".gettype($returnedarray)."</b>_<BR>";
    while(list($key,$val)=each($returnedarray)){
    echo "value <b>".$key."</b> is <b>".$val."</b><br>";
    }
}elseif($returnedval!=""){ echo "\$returnedval is: ".$returnedval."<br>"; } --------------------------------------------------------- --------------------------------------------------------------------
Strategic Business Systems                  (978) 745-2332
                      http://BusinessWebs.com/
--------------------------------------------------------------------

« previous php.general (#9930) next »