我正在使用Yii框架進行web開發。在Yii中需要命令PHP
我正在嘗試使電子郵件cron工作,爲此我使用PHPMailer。
這裏是我的配置/ console.php
> return array( > 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..', > 'name'=>'My Console Application', > > // preloading 'log' component > 'preload'=>array('log'), > 'import'=>array( > 'application.modules.*', > 'application.extensions.*', > 'application.components.*', > 'application.models.*', > ), ....
我命令/ testCommand.php
class UptimeCheckerCommand extends CConsoleCommand{ public function run($args) { .... $warning->send(); ....
我COMPONE NT/Warning.php
.... require("/protected/extensions/PHPMailer/class.phpmailer.php"); ....
錯誤報告:
PHP Error[2]: require(/protected/extensions/PHPMailer/class.phpmailer.php): fail ed to open stream: No such file or directory
我使用的控制器部分已經測試它和它的作品完美的罰款。錯誤只發生在我試圖使用yiic test命令訪問它時。
任何幫助將不勝感激
將require語句更改爲'require(「./ protected/extensi ...」)'時會發生同樣的錯誤嗎? – fijas