title: gearman gives me GEARMAN_COULD_NOT_CONNECT, it is definitely running
body: <p>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</p>
  
  <p>If I run the reverse_client.php script I get the GEARMAN_COULD_NOT_CONNECT error.</p>
  
  <p><code>PHP Warning:  GearmanClient::do(): send_packet(GEARMAN_COULD_NOT_CONNECT) Failed to send server-options packet -&gt; libgearman/connection.cc:430 in /home/bealers/build/gearman-1.1.1/examples/reverse_client.php on line 26</code></p>
  
  <p>There are a few similar posts on here about this and they all point to GM not running.</p>
  
  <p>It is <em>definitely</em> running. </p>
  
  <p>I'm starting it with these params:</p>
  
  <p><code>PARAMS="--queue-type=MySQL --mysql-db=test_db --mysql-user=gearman --mysql-password=gearman"</code></p>
  
  <p>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.</p>
  
  <p>I can also telnet to 4730 on localhost, so there's no firewall issue.</p>
  
  <p>Initially GM had problems starting because it was starting before mysql, so I edited the init script</p>
  
  <pre><code>### BEGIN INIT INFO
  # Provides:          gearman-job-server
  # Required-Start:    $network $remote_fs $syslog mysql
  </code></pre>
  
  <p>and an <code>update-rd.c gearman-job-server defaults</code> sets it to start after and it starts fine on boot up now.</p>
  
  <p>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</p>
  
  <p><code>ps ax | grep gearman</code> shows only one process running.</p>
  
  <p>Netstat shows only one process running`</p>
  
  <p><code>tcp        0      0 *:4730                  *:*                     LISTEN      2325/gearmand
  </code></p>
  
  <p>The PECL lib seems fine:</p>
  
  <p><code>php -i | grep gearman</code></p>
  
  <pre><code>/etc/php5/cli/conf.d/gearman.ini,
  gearman
  gearman support =&gt; enabled
  libgearman version =&gt; 1.1.5
  </code></pre>
  
  <p>I'm out of ideas</p>