Gearman , php extension problem : Class 'GearmanWorker' not found in .. using terminal but works on browser Gearman , php extension problem : Class 'GearmanWorker' not found in .. using terminal but works on browser php php

Gearman , php extension problem : Class 'GearmanWorker' not found in .. using terminal but works on browser


Type php --ini at your command prompt to see which php.ini your PHP CLI uses. Make sure Gearman is enabled in that php.ini.


using locate php.iniin my ubuntu laptop show 2 results:

/etc/php5/apache2/php.ini/etc/php5/cli/php.ini

add both extension=gearman.so into 2 php.ini filethen restart php and gearmand working now.


  1. Install the gearman job server and libgearman

    apt-get install gearman-job-server libgearman-dev

  2. Install the pecl extension

    apt-get install php-pear php5-devpecl install gearman

  3. Open the correct php.ini file and add extension=gearman.so at the end.