adman82 Posted March 24, 2010 Share Posted March 24, 2010 hi there , I'm trying to make a php page that will download a file with wget , and after the download show statistics , such as average speed , file size . i tested all of the oppions to run shell command . $result = system("wget -O tmp1 '$url' "); echo "the system results are: ".$result."<br>"; echo "<br>the shell_exec results are: " ; echo shell_exec("wget -O tmp2 '$url' ")."<br>"; $test = exec("wget -O tmp3 '$url' ",$tmp); print_r($tmp); echo "<br>the exec results are: "; print_r( $test); $test1 = `wget -O tmp4 "$url" `; echo "<br>the gershaim results are: "; echo "<pre>$test1</pre>"; $string = system('wget http://www.example.com/index.html ~',$file); echo $string; echo ' "test"'; and the results are : the system results are: the shell_exec results are: Array ( ) the exec results are: the gershaim results are: "test" All help is appreciated , thanks with advance ... Quote Link to comment https://forums.phpfreaks.com/topic/196308-recive-wget-log-from-php-web-page/ Share on other sites More sharing options...
premiso Posted March 24, 2010 Share Posted March 24, 2010 // add error reporting just to make sure errors are sown. error_reporting(E_ALL); ini_set('display_errors', 'on'); $result = system("wget -O tmp1 '$url' "); echo "the system results are: ".$result."<br>"; echo "<br>the shell_exec results are: " ; echo shell_exec("wget -O tmp2 '$url' ")."<br>"; $test = exec("wget -O tmp3 '$url' ",$tmp); print_r($tmp); echo "<br>the exec results are: "; print_r( $test); // $test1 = `wget -O tmp4 "$url" `; $test1 = '`wget -O tmp4 "' . $url . '"`'; // ecased in single quotes. echo "<br>the gershaim results are: "; echo "<pre>$test1</pre>"; $string = system('wget http://www.example.com/index.html ~',$file); echo $string; echo ' "test"'; Not exactly sure what you are expecting to get, but hopefully the error reporting and the $test1 line help get you on your way. Quote Link to comment https://forums.phpfreaks.com/topic/196308-recive-wget-log-from-php-web-page/#findComment-1030893 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.