0

我的 Symfony 2 应用程序出现以下错误。

Fatal error: Class 'GearmanClient' not found

更多信息:

  1. 来自php -m列表的结果gearman

    Meaning: Gearman Extension is installed.
    
  2. 结果来自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. 我还用以下代码制作了一个新文件:

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

    在网页上输出:

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

    没有像GearmanClient not found.

    Meaning: GearmanClient is found by the test application.
    

我不明白的是:

现在已经安装了 gearman 扩展,甚至可以通过测试应用程序找到 GearmanClient。为什么我的 symfony 应用程序会抛出这个错误。

我正在使用supertag/gearman-bundle

提前致谢。我真的很感激任何帮助。

4

0 回答 0