I'm having trouble using wget with shell_exec. Looks as if shell_exec is working, I can do an ls command and get output to the browser but I'm not getting any results from wget. If I run the wget command directly in the terminal it works fine. I also opened all permissions on the uploading folder for testing.
The Script:
$title = "test";
$image = "http://www.wenworld.com/images/2004/12/02/1102013838_s.jpg";
UpdateImage($title, $image);
function UpdateImage($title, $image) {
$filename = $_SERVER["SCRIPT_FILENAME"];
$filename = ereg_replace("image_select.php", "", $filename);
$filename = $filename."images/".date("U").".jpg";
echo "wget '".$image."' -O '".$filename."'";
echo "<hr>";
$output = shell_exec("wget '".$image."' -O '".$filename."'") or die ("Problem downloading");
echo $output;
}
The Output:
wget 'http://www.wenworld.com/images/2004/12/02/1102013838_s.jpg' -O '/Webserver/movielist/images/1102088059.jpg'
-----------------hr-----------------
Problem downloading
Any idea why I'm not getting this file /Webserver/movielist/images/1102088059.jpg?
Thanks