title: Gearman , php extension problem : Class 'GearmanWorker' not found in .. using terminal but works on browser
body: <p>I've installed gearman on ubuntu 10.04 recently and installed it's pecl extension. Now , when I run a php file in the browser that contains :</p>
  
  <pre><code>$client = new GearmanWorker();
  die(var_Dump($client));
  </code></pre>
  
  <p>I get <code>object(GearmanWorker)#1 (0) { }</code></p>
  
  <p>but when running the a real worker file in terminal (by root) , I get this:</p>
  
  <pre><code>sudo php worker.php
  PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/imagick.ini on line 1 in Unknown on line 0
  PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0
  PHP Warning:  Module 'pcntl' already loaded in Unknown on line 0
  PHP Fatal error:  Class 'GearmanWorker' not found in /home/ME/public_html/try/worker.php on line 3
  </code></pre>
  
  <p>The worker code :</p>
  
  <pre><code>#!/usr/bin/php 
  &lt;?php $worker= new GearmanWorker();
  $worker-&gt;addServer('127.0.0.1');
  $worker-&gt;addFunction("reverse", "reverse_fn");
  while (1) {
      print "Waiting for job...\n";
      $ret = $worker-&gt;work();
      if ($worker-&gt;returnCode() != GEARMAN_SUCCESS)
          break;
  }
  function reverse_fn ($job)
  {
      $workload = $job-&gt;workload();
      echo "Received
   job: " . $job-&gt;handle() . "\n";
      echo "Workload: $workload\n";
      $result = strrev($workload);
      for ($i = 1; $i &lt;= 10; $i ++) {
          $job-&gt;status($i, 10);
          sleep(1);
      }
      echo "Result: $result\n";
      return $result;
  }
  </code></pre>
  
  <p>Please help!</p>