Php OrientDB-无法从套接字读取
我现在想使用OrientDB在服务器上存储一些数据,即localhost。使用来自的官方图书馆。 但是,在尝试连接时,我收到以下失败消息:Php OrientDB-无法从套接字读取,php,server,orientdb,graph-databases,Php,Server,Orientdb,Graph Databases,我现在想使用OrientDB在服务器上存储一些数据,即localhost。使用来自的官方图书馆。 但是,在尝试连接时,我收到以下失败消息: Fatal error: Uncaught exception 'PhpOrient\Exceptions\SocketException' with message 'socket_read(): unable to read from socket [104]: Connection reset by peer' in /Library/WebSer
Fatal error: Uncaught exception 'PhpOrient\Exceptions\SocketException' with message
'socket_read(): unable to read from socket [104]: Connection reset by peer' in
/Library/WebServer/Documents/T1/vendor/ostico/phporient/src/PhpOrient/Protocols/Binary/OrientSocket.php on line 147
有什么不对劲?我可以连接并进入localhost:2480上的OrientDB Studio,但这里似乎出了问题
<?php
require "../vendor/autoload.php";
use PhpOrient\PhpOrient;
$client = new PhpOrient( 'localhost', 2480 );
$client->connect('root','pwd');
echo "1";
$client->dbList();
?>
请尝试使用以下代码进行连接:
<?php
require "../vendor/autoload.php";
use PhpOrient\PhpOrient;
$client = new PhpOrient();
$client->hostname = 'localhost';
$client->port = 2424;
$client->username = 'root';
$client->password = 'pwd';
$client->connect();
echo "DB list: <br /><br /> ";
echo '<pre>'; print_r($client->dbList()); echo '</pre>';
echo "<br /> <br /> DB Listed above successfully!";
?>
您应该使用2424端口。
希望有帮助。尝试使用以下代码连接:
<?php
require "../vendor/autoload.php";
use PhpOrient\PhpOrient;
$client = new PhpOrient();
$client->hostname = 'localhost';
$client->port = 2424;
$client->username = 'root';
$client->password = 'pwd';
$client->connect();
echo "DB list: <br /><br /> ";
echo '<pre>'; print_r($client->dbList()); echo '</pre>';
echo "<br /> <br /> DB Listed above successfully!";
?>
您应该使用2424端口。
希望对您有所帮助。如果答案对您有效,您应该单击旁边的复选标记将其标记为已接受答案。如果答案对您有效,您应该单击旁边的复选标记将其标记为已接受答案。