doucuo8618 2010-01-06 18:11
浏览 32
已采纳

PHP exec_shell使用unrar.exe

I'm running the following php code;

$output = exec('"D:\TESTDIR\unrar.exe" e "D:\TESTDIR\Icons.rar" -ppassword');
echo $output;

Which isn't working... I want it to extract the files into the same directory. If I copy the contents of the exec into a command line prompt it works just fine, so slightly confused.

Trying the following;

$output = exec('"D:\TESTDIR\unrar.exe"');
echo $output;

Returns the last line of the unrar help file (which is expected).

  • 写回答

1条回答 默认 最新

  • douou8954 2010-01-06 19:16
    关注

    Is it possible to add a destination to the command so you can tell unrar where to place the unpacked files?

    Probably PHP now is trying to unpack it in the directory the php file is located.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?