My dev server is Debian Squeeze and I'm running Gearman 1.1.5 which I compiled from source along with the php pecl extension v1.1.1
If I run the reverse_client.php script I get the GEARMAN_COULD_NOT_CONNECT error.
PHP Warning: GearmanClient::do(): send_packet(GEARMAN_COULD_NOT_CONNECT) Failed to send server-options packet -> libgearman/connection.cc:430 in /home/bealers/build/gearman-1.1.1/examples/reverse_client.php on line 26
There are a few similar posts on here about this and they all point to GM not running.
It is definitely running.
I'm starting it with these params:
PARAMS="--queue-type=MySQL --mysql-db=test_db --mysql-user=gearman --mysql-password=gearman"
If I drop the gearman_queue table in test_db then restart the daemon the table is recreated, so its mysql connection is fine and it's clearly starting.
I can also telnet to 4730 on localhost, so there's no firewall issue.
Initially GM had problems starting because it was starting before mysql, so I edited the init script
### BEGIN INIT INFO
# Provides: gearman-job-server
# Required-Start: $network $remote_fs $syslog mysql
and an update-rd.c gearman-job-server defaults
sets it to start after and it starts fine on boot up now.
The only other thing I can think of is that initially I'd installed via apt but the version was to old so I removed it and compiled from source. /usr/sbin/gearmand no longer exists the only version is /usr/local/sbin/gearmand
ps ax | grep gearman
shows only one process running.
Netstat shows only one process running`
tcp 0 0 *:4730 *:* LISTEN 2325/gearmand
The PECL lib seems fine:
php -i | grep gearman
/etc/php5/cli/conf.d/gearman.ini,
gearman
gearman support => enabled
libgearman version => 1.1.5
I'm out of ideas