使用带有Laravel的php-resque时,“常量CRLF已定义”错误

时间:2013-03-05 16:23:07

标签: php redis laravel resque php-resque

我在Ubuntu 12.04上与Laravel 3一起运行php-resque

问题:当作业在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.

1 个答案:

答案 0 :(得分:1)

这是一个猜测,但我会在/var/www/dev/vendor/chrisboulton/php-resque/lib/Redisent/Redisent.php中说第10行有第二个define('CRLF', 'something'),如果您希望这两个软件一起工作,则可能会被注释掉。