1
我正在尝试使用gearman
使用GearmanClient
类从gearman-php-extensions创建任务。我能够在下面的程序运行使用命令prompt-Yii无法找到GearmanClient
//php client.php works fine
<?php
$client= new GearmanClient();
$client->addServer();
$task = $client->do("send", "hi");
?>
但我wan't运行在一些yii controller
这个代码。看起来好像yii
是无法找到类的路径达到GearmanClient
,但为什么?
另外我正在写程序eclipse
。由于php
命令和eclipse
都使用相同的php
库,所以我的yii
控制器应该正常工作。相反,我的浏览器提供了错误的喜欢 -
PHP warning
include(GearmanClient.php): failed to open stream: No such file or directory
#plus some warnings and the yii stack trace.
该文件位于何处?你怎么包括它?上面代码中的 –
是'protected/controllers/ReportsController.php'的一部分。希望你知道'yii'层次结构。当我在client.php中放入5行代码片段时,它可以在'terminal'中使用'php <程序名称>'。但它不能在浏览器中运行。 – Hussain
不,我的意思是,'GearmanClient.php'文件在哪里?你怎么包括它?你可能会指定错误的路径,这将是PHP为你提供这样的错误的原因。 –