使shell zip可供php访问

使shell zip可供php访问,shell,shell-exec,Shell,Shell Exec,Hi获得了一个使用PHP7.2.5的Ubuntu18.04的LEMP堆栈 服务器信息显示 支持Shell Exec 不支持Shell Exec Zip 因此,我的一些插件说 此服务器未配置为Shell Zip引擎-请使用其他引擎模式。要使“Shell Zip”可用,请让您的主机: 1.安装zip可执行文件并使其可供PHP访问 我试过这个密码 并且该功能已启用 然而,当我用下面的代码测试它是否可执行时,什么都没有发生 正如德国的Danfrom所指出的,您可能会检查它是否正确 可执行文件。像这样的

Hi获得了一个使用PHP7.2.5的Ubuntu18.04的LEMP堆栈 服务器信息显示 支持Shell Exec 不支持Shell Exec Zip

因此,我的一些插件说 此服务器未配置为Shell Zip引擎-请使用其他引擎模式。要使“Shell Zip”可用,请让您的主机: 1.安装zip可执行文件并使其可供PHP访问

我试过这个密码

并且该功能已启用

然而,当我用下面的代码测试它是否可执行时,什么都没有发生

正如德国的Danfrom所指出的,您可能会检查它是否正确 可执行文件。像这样的东西就行了

或者尝试了这个,也不返回任何内容,只返回白色页面

 // Exec function exists.
    // Exec is not disabled.
    // Safe Mode is not on.
    $exec_enabled =
       function_exists('exec') &&
       !in_array('exec', array_map('trim', explode(', ', ini_get('disable_functions')))) &&
       strtolower(ini_get('safe_mode')) != 1
    ;


    if($exec_enabled) { exec('blah'); }
我也检查了下面的代码从和它的工作

// helper function
function checkShellCommand($command) {
    $returnValue = shell_exec("$command");
    if(empty($returnValue)) {
        return false;
    } else {
        return true;
    }
}

// test the shell command you'd like to use
if (!checkShellCommand('uname -a')) {
    print 'This command cannot be executed.';
} else {
    echo shell_exec('uname -a');
}
那么,有谁能告诉我怎样才能让PHP访问它

非常感谢

这是由

apt get install zip解压
 // Exec function exists.
    // Exec is not disabled.
    // Safe Mode is not on.
    $exec_enabled =
       function_exists('exec') &&
       !in_array('exec', array_map('trim', explode(', ', ini_get('disable_functions')))) &&
       strtolower(ini_get('safe_mode')) != 1
    ;


    if($exec_enabled) { exec('blah'); }
// helper function
function checkShellCommand($command) {
    $returnValue = shell_exec("$command");
    if(empty($returnValue)) {
        return false;
    } else {
        return true;
    }
}

// test the shell command you'd like to use
if (!checkShellCommand('uname -a')) {
    print 'This command cannot be executed.';
} else {
    echo shell_exec('uname -a');
}