wiki/HowtoGearman.md

44 lines
963 B
Markdown
Raw Normal View History

2016-12-29 11:25:39 +01:00
**Cette page a été importée automatiquement de notre ancien wiki mais n'a pas encore été révisée.**
# Howto Gearman
Installation :
~~~
# aptitude install gearman gearman-job-server
~~~
Vérification du statut / fonctionnement :
~~~
$ telnet 127.0.0.1 4730
STATUS
foo 310 2 2
bar 0 0 1
coin 0 0 1
plop 0 0 1
.
WORKERS
14 127.0.0.1 - :
13 127.0.0.1 - : foo
12 127.0.0.1 - : bar coin plop
11 127.0.0.1 - : foo
.
~~~
Utilisation avec PHP :
~~~
$ pecl download gearman-1.0.3
$ dh-make-pecl --phpversion 5 --prefix php5- gearman-1.0.3.tgz
$ cd php5-gearman-1.0.3/
$ ./debian/rules binary
# dpkg -i ../php5-gearman_1.0.3-1_amd64.deb
~~~
Note : si vous obtenez des erreurs du type `PHP Fatal error: Uncaught exception 'GearmanException' with message 'Failed to set exception option`
Précisez le HOST et PORT pour la fonction addServer : _addServer("127.0.0.1", 4730)_