PHP.ini 中启用了套接字,但出现了套接字错误,可能与 OrientDB 有关。

huangapple go评论68阅读模式
英文:

Error on socket even though socket is enabled in PHP.ini for OrientDB

问题

I need help with the problem I found. I use OrientDB and connect it with PHP, then I get the error as below:

> Fatal error: Uncaught PhpOrient\Exceptions\SocketException: Error 0: The operation completed successfully in C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\Protocols\Binary\OrientSocket.php:91 <br> Stack trace: <br> #0 C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\Protocols\Binary\SocketTransport.php(146): PhpOrient\Protocols\Binary\OrientSocket->connect() <br> #1 C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\Protocols\Binary\Abstracts\Operation.php(76): PhpOrient\Protocols\Binary\SocketTransport->getSocket() <br> #2 C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\Protocols\Binary\SocketTransport.php(223): PhpOrient\Protocols\Binary\Abstracts\Operation->__construct(Object(PhpOrient\Protocols\Binary\SocketTransport)) <br> #3 C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\Protocols\Binary\SocketTransport.php(161): PhpOrient\Protocols\Binary\SocketTransport->operationFactory('PhpOrient\Proto...', Array) <br> #4 C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\PhpOrient.php(247): PhpOrient\Protocols\Binary\SocketTransport->execute('connect', Array) <br> #5 C:\xampp\htdocs\tugas\coba.php(8): PhpOrient\PhpOrient->connect() <br> #6 {main} thrown in C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\Protocols\Binary\OrientSocket.php on line 91

Here is the PHP file:

<?php
require "PhpOrient/vendor/autoload.php";
use PhpOrient\PhpOrient;

$client = new PhpOrient( 'localhost', 2424 );
$client->username = 'root';
$client->password = '0r13ntDB';
$client->connect();
?>

And I already turned on the sockets extension in php.ini:

; The MIBS data available in the PHP distribution must be installed.
; See https://www.php.net/manual/en/snmp.installation.php
;extension=snmp

;extension=soap
extension=sockets
;extension=sodium
;extension=sqlite3
;extension=tidy
extension=xsl

Maybe I missed something?

英文:

i need help with the problem I found. I use OrientDB and connect it with PHP, then i get the error as below:

>Fatal error: Uncaught PhpOrient\Exceptions\SocketException: Error 0 : The operation completed successfully in C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\Protocols\Binary\OrientSocket.php:91 <br>Stack trace: <br>#0 C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\Protocols\Binary\SocketTransport.php(146): PhpOrient\Protocols\Binary\OrientSocket->connect() <br>#1 C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\Protocols\Binary\Abstracts\Operation.php(76): PhpOrient\Protocols\Binary\SocketTransport->getSocket() <br>#2 C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\Protocols\Binary\SocketTransport.php(223): PhpOrient\Protocols\Binary\Abstracts\Operation->__construct(Object(PhpOrient\Protocols\Binary\SocketTransport))
<br>#3 C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\Protocols\Binary\SocketTransport.php(161): PhpOrient\Protocols\Binary\SocketTransport->operationFactory('PhpOrient\Proto...', Array) <br>#4 C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\PhpOrient.php(247): PhpOrient\Protocols\Binary\SocketTransport->execute('connect', Array)
<br>#5 C:\xampp\htdocs\tugas\coba.php(8): PhpOrient\PhpOrient->connect() <br>#6 {main} thrown in C:\xampp\htdocs\tugas\PhpOrient\src\PhpOrient\Protocols\Binary\OrientSocket.php on line 91

Here is the php file:

&lt;?php
require &quot;PhpOrient/vendor/autoload.php&quot;;
use PhpOrient\PhpOrient;

$client = new PhpOrient( &#39;localhost&#39;, 2424 );
$client-&gt;username = &#39;root&#39;;
$client-&gt;password = &#39;0r13ntDB&#39;;
$client-&gt;connect();
?&gt;

and i already turn on sockets extension on php.ini :

; The MIBS data available in the PHP distribution must be installed.
; See https://www.php.net/manual/en/snmp.installation.php
;extension=snmp

;extension=soap
extension=sockets
;extension=sodium
;extension=sqlite3
;extension=tidy
extension=xsl

maybe I missed something?

答案1

得分: 1

发现 OrientDB 不支持 PHP 版本 8,当我将它更改为 PHP 版本 7.x 时,一切都正常运行。

如果你正在使用 OrientDB,在安装时不要忘记调整以下错误:

  1. require-dev.Ostico/phpdoc-md 无效,它不应包含大写字符。请改为使用 ostico/phpdoc-md。
  2. Root composer.json 要求 phpdocumentor/phpdocumentor dev-master -> 可满足于 phpdocumentor/phpdocumentor[dev-master]

修复方法:
打开你的 PhpOrient 文件夹中的 composer.json 然后:

  1. 在 "require-dev" 中将 "Ostico/phpdoc-md" 更改为 "ostico/phpdoc-md"
  2. 删除 "require-dev" 中的 "phpdocumentor/phpdocumentor",然后手动安装 https://github.com/phpDocumentor/phpDocumentor/releases
英文:

it turns out that OrientDB does not support PHP version 8, when I change it to PHP version 7.x everything runs normally.

If you are using OrientDB don't forget to adjust the following bugs when installing:

> 1. require-dev.Ostico/phpdoc-md is invalid, it should not contain uppercase characters. Please use ostico/phpdoc-md instead.
> 2. Root composer.json requires phpdocumentor/phpdocumentor dev-master -> satisfiable by phpdocumentor/phpdocumentor[dev-master]

Fixing :
> Open composer.json in your PhpOrient folder then :
> 1. Make changes to "Ostico/phpdoc-md" to "ostico/phpdoc-md" in "require-dev"
> 2. The removal of "phpdocumentor/phpdocumentor" in "require-dev" was replaced by a manual installation of
> https://github.com/phpDocumentor/phpDocumentor/releases

huangapple
  • 本文由 发表于 2023年5月25日 16:27:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/76330277.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定