I have wget installed on my server but it doesn't work in php. I am getting "Not installed":
passthru("wget --version",$return_var); if ($return_var!=0) { display_message("Not installed"); exit; }
I tried:
passthru("/usr/bin/wget --version",$return_var);
But it doesn't help. How can I use wgen in php?
What is the value of $return_var, exactly? All "Not installed" means is that it's not zero.
display_message($return_var);
$return_var is 126.
Have you tried specifying the full path to wget in your script? If you don't know where that is, go to the command line and type 'whereis wget' (sans quotes) This sort of problem can exists as the web server runs as a different user, which has a different path variable from what you'd have as a regular user.
server:~# which wget /usr/bin/wget
I tried to provide full path:
but it doesn't help.
At the same time I don't have any problems with, for example, Imagemagick in my php scripts.
only a thought, but there nothing wget does that can be done in php, starting with file_get_contents()
As dragon said try http://in.php.net/stream