サーバーにgearmand1.1.5をインストールし、サーバーの起動後にインストールで提供された例を試しました。それらはかなり正しく機能します(エコーの例は機能し、逆は期待どおりに機能しませんが、エラーは発生しません)。
次に、peclを使用してphpラッパーをインストールしました。バージョンは最後の安定版(1.1.1)です。明らかに、php.iniに拡張子を追加し、php --info|grepギアマンの出力は次のとおりです。
gearman
gearman support => enabled
libgearman version => 1.1.5
PWD => /root/gearman-1.1.1/examples
OLDPWD => /root/gearman-1.1.1
_SERVER["PWD"] => /root/gearman-1.1.1/examples
_SERVER["OLDPWD"] => /root/gearman-1.1.1
次に、peclパッケージのechoの例を試しましたが、ワーカーは正しく起動します。
[~/gearman-1.1.1/examples]# php reverse_worker.php
Starting
Waiting for job...
代わりに、クライアントは次のエラーを表示します。
[~/gearman-1.1.1/examples]# php reverse_client.php
Starting
Sending job
PHP Warning: GearmanClient::do(): send_packet(GEARMAN_COULD_NOT_CONNECT) Failed to send server-options packet -> libgearman/connection.cc:430 in /root/gearman-1.1.1/examples/reverse_client.php on line 26
PHP Stack trace:
PHP 1. {main}() /root/gearman-1.1.1/examples/reverse_client.php:0
PHP 2. GearmanClient->do() /root/gearman-1.1.1/examples/reverse_client.php:26
Warning: GearmanClient::do(): send_packet(GEARMAN_COULD_NOT_CONNECT) Failed to send server-options packet -> libgearman/connection.cc:430 in /root/gearman-1.1.1/examples/reverse_client.php on line 26
Call Stack:
0.0001 228408 1. {main}() /root/gearman-1.1.1/examples/reverse_client.php:0
0.0003 229552 2. GearmanClient->do() /root/gearman-1.1.1/examples/reverse_client.php:26
RET: 26
ギアマンデーモンのログには、このphpテストのアクティビティの兆候はありませんが、私が試した以前のすべての例がログに記録されています。
このエラーを修正するにはどうすればよいですか?ありがとう。