jiangle
V2EX  ›  问与答

PHP 用 exec 调用 workerman,返回 127 错误码是什么意思?

  •  
  •   jiangle · Jan 19, 2017 · 1739 views
    This topic created in 3404 days ago, the information mentioned may be changed or developed.

    php /www/web/yxxx_com/public_html/Tasks/start.php start -d

    127

    如果复制到xshell,用root权限执行,那就没问题。

    apache 下的用户是:www

    修改过:/etc/sudoer www ALL=(ALL) NOPASSWD:ALL

    还是不行,求解....

    核心代码如下:

    public function task_start(){
        $getToken = $_GET['token'];  
        if ($this->token_info['token'] == $getToken) {
            p("php ".WORKERMANER_PATH."/start.php start -d");
          	exec("php ".WORKERMANER_PATH."/start.php start -d", $arr, $status);
            p($status);exit;
            if ($status == 0) {
                $this->success('启动成功');
            }else{
                $this->error('启动失败');
            }
        }else{
            $this->error('开启令牌错误或者已过期,请刷新页面重新开启');
        }
    }
    
    1 replies    2017-01-20 18:07:03 +08:00
    jiangle
        1
    jiangle  
    OP
       Jan 20, 2017
    没有大神懂吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3056 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 13:14 · PVG 21:14 · LAX 06:14 · JFK 09:14
    ♥ Do have faith in what you're doing.