PHP Laravel和SSH1或SSH2不工作

时间:2016-05-01 05:33:14

标签: javascript php laravel ssh

所以我有一个问题让php ssh2在laravel中工作。我认为laravel导致了这个问题,因为它似乎与外部php库有关。 这就是我所拥有的。

test.php的

<?php

namespace App\Core\Framework;    
use App\Core\Helpers\Libs\SSH\Net\Net_SSH1;

class SSHServer {
    public function __construct() {
        $ssh = new Net_SSH1("192.99.238.228");
        $ssh->login('root','password');
    }
}

我的SSH1.php http://pastebin.com/xyXtb89s

这是我得到的错误。

    Use of undefined constant NET_SSH1_CMSG_EOF - assumed 'NET_SSH1_CMSG_EOF'
in SSH1.php line 1068
at HandleExceptions->handleError('8', 'Use of undefined constant NET_SSH1_CMSG_EOF - assumed 'NET_SSH1_CMSG_EOF'', '/home/admin/web/gamecp.treeboxservers.com/core/app/Core/Helpers/Libs/SSH/Net/SSH1.php', '1068', array('msg' => 'Client Quit')) in SSH1.php line 1068
at Net_SSH1->_disconnect() in SSH1.php line 1056
at Net_SSH1->__destruct() in Test.php line 9
at SSHServer->__construct() in Test.php line 9
at Test->index()
at call_user_func_array(array(object(Test), 'index'), array()) in compiled.php line 8287
at Controller->callAction('index', array()) in compiled.php line 8354
at ControllerDispatcher->call(object(Test), object(Route), 'index') in compiled.php line 8333
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 8952
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 8935
at Pipeline->then(object(Closure)) in compiled.php line 8334
at ControllerDispatcher->callWithinStack(object(Test), object(Route), object(Request), 'index') in compiled.php line 8320

我一直试图让这个工作超过一天,它终于让我太烦了....

0 个答案:

没有答案