Class 'GearmanClient' not found. Extension gearman.so installed already

822 views Asked by At

I am getting below error in my Symfony 2 Application.

Fatal error: Class 'GearmanClient' not found

More Info:

  1. Result from php -m lists gearman.

    Meaning: Gearman Extension is installed.
    
  2. Result from php --info | grep gearman:

    /etc/php.d/40-gearman.ini
    gearman
    gearman support => enabled
    libgearman version => 1.1.12      
    
    Meaning: Gearman Extension is installed.
    
  3. I also made a new file with following code:

    <?php
      $gmc = new GearmanClient();
      $gmc->addServer('localhost');
    
      print $gmc;
    ?>
    

    which outputs on the webpage:

    Catchable fatal error: Object of class GearmanClient could not be converted to string in /var/www/test-gearman/gearman.php on line 5
    

    There are no errors like GearmanClient not found.

    Meaning: GearmanClient is found by the test application.
    

What I don't understand is:

Now that gearman extension is installed and GearmanClient is even found by the test application. Why is my symfony application throwing this error.

I am using supertag/gearman-bundle.

Thanks in advance. I really appreciate any help.

0

There are 0 answers