如何为pcntl_exec提供适当的权限?

时间:2013-07-06 20:39:26

标签: php process

我正在尝试使用pcntl_exec命令分叉php脚本并执行另一个php脚本,但我收到以下错误:

pcntl_exec(): Error has occured: (errno 13) Permission denied

我正在尝试在函数中正常分叉后跟随代码:

    $pathToFile="/var/www/html";
    $outputfile =array("mytestfile.php");
    if ($pid) // parent
    {
          $pid_arr[$i] = $pid;
    }
    else // child
    { 
           pcntl_exec($cmd,$outputfile);
           return "error occurred in child";
    }

所有其他pcntl函数都正常工作,我也在我的目录上尝试了chmod和chown命令,但仍然没有pcntl_exec工作。请告诉我我做错了什么?

提前致谢!!

1 个答案:

答案 0 :(得分:1)

尝试此选项:

chmod 755 /var/www/html

这应该授予您所需的许可!

相关问题