Page 1 of 1

Help, I'm driving mad !!

Posted: Mon Jan 26, 2004 4:37 am
by chouchou
Ok. That's simple. Here it is

Code: Select all

<?php
  $result = shell_exec("wget -q -O - 'http://www.google.com'");
  echo $result;
?>
That's supposed to print on the standard output the source code of the web page http://www.google.com. Note I can't use fopen function because I'm behind a firewall.

Well the script works from the terminal, but it doesn't work with apache !! It doesn't display anything !!

Thanks for help !!

Posted: Mon Jan 26, 2004 8:00 am
by John Cartwright
never knew firewalls didnt allow fopen :S and I don't see why

Posted: Mon Jan 26, 2004 8:16 am
by Gonik
since this is a unix command try not to place the URL inside the single quotes. Also, as far as i remember, the -O parameter also requires a filename to output the file contents.

You can find many usefull information about wget @ http://www.gnu.org/software/wget/manual ... /wget.html
?>

Posted: Tue Jan 27, 2004 9:50 am
by dimitris
Gonik wrote:since this is a unix command try not to place the URL inside the single quotes. Also, as far as i remember, the -O parameter also requires a filename to output the file contents.

You can find many usefull information about wget @ http://www.gnu.org/software/wget/manual ... /wget.html
?>
I agry with Gonik that you should output the results to another file then the syntax will be ok! :wink: