7zip命令从命令行执行,但不在php脚本中执行

7zip命令从命令行执行,但不在php脚本中执行,php,command-line,command,7zip,Php,Command Line,Command,7zip,我试图写一个脚本,自动解压7zip档案。我能够从命令提示符下运行该命令,但在php脚本中运行时它不起作用 以下是我对代码的理解: $filefolder = "F:/dev/"; $filename = "archive.7z"; $filepath = $filefolder . $filename; $unzip = "cmd /c 7z x " . $filePath . " -o" . $fileFolder . " -spf"; print_r($unzip . "<br>

我试图写一个脚本,自动解压7zip档案。我能够从命令提示符下运行该命令,但在php脚本中运行时它不起作用

以下是我对代码的理解:

$filefolder = "F:/dev/";
$filename = "archive.7z";
$filepath = $filefolder . $filename;

$unzip = "cmd /c 7z x " . $filePath . " -o" . $fileFolder . " -spf";
print_r($unzip . "<br>"); //checking to make sure the command is formed correctly
exec($unzip, $outcome, $rtnStatus);
print_r($outcome);
print_r($rtnStatus);

我在这里遗漏了什么?

你是指CLI php脚本还是web脚本?这是一个web脚本。web服务器用户不知道
7z
在哪里:
c:/some path/to/7z
一个关于什么特别不起作用的解释?我在不久前遇到了一些问题。你可以看看是否有帮助。你是说在CLI php脚本还是web脚本中?这是一个web脚本。web服务器用户不知道
7z
在哪里:
c:/some path/to/7z
一个关于什么特别不起作用的解释?我刚才遇到了一些问题。你可以看看这是否有帮助。
Array ( ) 
1