我只是在安装了CentOS7的服务器上部署gearman。我通过PHP使用gearman,我还安装了图书馆' libgearman'。
当我运行正确运行在另一台服务器上的PHP脚本时,添加gearman服务器时出现以下错误:
<tr style="page-break-inside: avoid;">
<!-- A little border to see the result more easily -->
<td style="border: solid 1px blue;">
Large text possibly displayed on several pages ...
Large text possibly displayed on several pages ...
Large text possibly displayed on several pages ...
Large text possibly displayed on several pages ...
</td>
<td>col2</td>
<td>col3</td>
</tr>
我已经读到这个错误通常是因为Gearman服务器和libgearman的版本不同或者还有一个设备服务器停止了。
我已验证版本相同且服务器正在运行,但仍会显示此消息。
Fatal error: Uncaught exception 'GearmanException' with message 'Failed to set exception option' in /var/www/html/dev1/index.php:9 Stack trace: #0 /var/www/html/dev1/index.php(9): GearmanClient->addServer('127.0.0.1', 4730) #1 {main} thrown in /var/www/html/dev1/index.php on line 9
[root@localhost integracion]# gearadmin --server-version
1.1.12
[root@localhost integracion]# php -v
PHP 5.4.16 (cli) (built: Jun 23 2015 21:17:27)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
[root@localhost integracion]# httpd -v Server version: Apache/2.4.6 (CentOS)
Server built: Nov 19 2015 21:43:13
<?php
# Se crea el objeto cliente
$gmclient= new GearmanClient();
# Se añade el servidor por defecto (localhost).
$gmclient->addServer("127.0.0.1", 4730);
?>
任何人都可以帮助我吗?谢谢!
答案 0 :(得分:1)
首先找到你的装备安装路径ep:/ usr / local / gearman /。 启动gearmand: / usr / local / gearman / sbin / gearmand -d 然后,运行PHP脚本。
答案 1 :(得分:0)
以下针对我在Ubuntu 16.04上修复了此错误
1)见https://github.com/gearman/gearmand/releases
2)安装最新版本(对我来说是1.1.17)
sudo apt-get install gcc autoconf bison flex libtool make libboost-all-dev libcurl4-openssl-dev curl libevent-dev memcached uuid-dev libsqlite3-dev libmysqlclient-dev gperf
sudo apt-get install libmysqld-dev
cd /usr/local/src/
sudo wget https://github.com/gearman/gearmand/releases/download/1.1.17/gearmand-1.1.17.tar.gz
cd gearmand-1.1.17/
sudo ./configure
sudo make
sudo make install
sudo service gearman-job-server restart