0
我在Ubuntu 12.04上與Laravel 3一起運行php-resque
。當Laravel使用php-resque時出現「Constant CRLF already defined」錯誤
問題:當工作在resque入隊,我得到以下錯誤:
Unhandled Exception
Message:
Constant CRLF already defined
Location:
/var/www/dev/vendor/chrisboulton/php-resque/lib/Redisent/Redisent.php on line 10
什麼是錯誤的意思是,我們怎樣才能解決呢?
PHP
// Enqueue in Resque
$data = array(
'name' => $name,
'email' => $email,
'created_at' => DB::raw('NOW()')
);
Resque::enqueue('queue', 'exampleWorker', $data);
然而,當我嘗試使用排隊一個artisan
工作,它的工作原理!
任務
class Queue_Task
{
public function run()
{
// Autoload composer vendors.
require path('composer').DS.'autoload.php';
$args = array('name' => 'John Smith');
Resque::enqueue('MyAppName', 'ExampleWorker', $args);
echo "Resque job queued.\n";
return;
}
}
輸出
PHP Notice: Constant CRLF already defined in /var/www/dev/vendor/chrisboulton/php-resque/lib/Redisent/Redisent.php on line 10
Notice: Constant CRLF already defined in /var/www/dev/vendor/chrisboulton/php-resque/lib/Redisent/Redisent.php on line 10
Resque job queued.
爲什麼這個工作可以使用'artisan'成功排隊? – Nyxynyx 2013-03-05 16:37:11
@Nyxynyx因爲它只是提出警告,而不是致命的例外。 – Sammitch 2013-03-05 16:39:39