作者Jerr (身為老爸老媽嚕..)
看板Linux
標題Re: [問題]在PHP中使用WGET指令
時間Mon Sep 28 15:01:15 2009
※ 引述《asdhhhman (無名)》之銘言:
: php程式放在Linux
: 想在PHP上寫入WGET指令以抓取檔案
: 有在網路上找過資料 但是程式都沒反應
: <?
: $moo = exec("wget http://140.113.216.55:8080/ipld/006.jpg");
: echo "$moo";
: ?>
: 不知道哪裡有問題
: 還是寫法有錯?
PATH 的環境變數有設對嗎?
getenv('PATH')看一下有沒有包括 wget 的目錄吧
btw, 如果單純要抓檔案回來何不用 file & file_put_contents ?
$bytes = file_put_contents(
$filename, implode( file($url) )
);
or curl 是更好的選擇
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.169.108.212
推 asdhhhman:謝謝 09/28 15:14
推 dowbatw:(str) file_get_contents($url) 10/02 00:48