Re: [請益] 如何使用外部指令 exec解壓縮?
※ 引述《dinos (來游泳吧~~)》之銘言:
: ※ 引述《micchiu (PP )》之銘言:
: : 請問我想在php的網頁中使用外部指令exec去呼叫unzip
: : 來解縮主機中的壓縮檔,我之前是這樣寫:
: : $command = "unzip ".$filename;
: : exec($command);
: : 可是檔案上傳後就是無法自己解壓縮,
: : 也使用過寫入完整路徑,但就是無法解壓縮,但也沒有錯誤發生…
: : 請問我該如何改呢,謝謝大家的指導~<(_|_)>
: system($cmd) 可以把訊息印出來
: % /usr/local/bin/unzip -d [path] -oxq [filename]
: 所以就是
: $cmd = sprintf("%s/unzip -d %s/ -oxq %s",
: _GLOBALS_DIR_BIN,$targetdir,$filename);
我有試用,可是還是不行…
我有試exec("ipconfig");
但是沒有任何東西印出來,不知道該如何改進,
謝謝大家的指點
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.122.65.54
推
05/10 14:52, , 1F
05/10 14:52, 1F
討論串 (同標題文章)