Class 'Pheanstalk_Pheanstalk' not found in Laravel 4 with Beanstalk
Asked Answered
C

4

5

I'm trying to get beanstalk up and running and I'm getting the exception when trying to run Queue::push():

Class 'Pheanstalk_Pheanstalk' not found

I've run composer require pda/pheanstalk, and even regenerated my auto-load file an extra time.

It's happening in ./vendor/laravel/framework/src/Illuminate/Queue/Connectors/BeanstalkdConnector.php

Any ideas?

Contain answered 19/6, 2014 at 16:33 Comment(0)
B
9

In composer.json, replace the pda/pheanstalk requirement line by

"pda/pheanstalk": "2.0.*"

Run

composer update

Warning: will also update Laravel.

Source: http://laravel.io/forum/07-17-2014-class-pheanstalk-pheanstalk-not-found

Beneficiary answered 15/9, 2014 at 19:11 Comment(0)
C
2

Disregard. Found the answer at https://github.com/laravel/framework/issues/746. Apparently the newest version has been reorganized or something.

Contain answered 19/6, 2014 at 19:11 Comment(0)
E
1

You may be using pheanstalk 3 which didn't work for me with Laravel 4. Use this command to switch to an older version:

composer require pda/pheanstalk "~2.1"
Expository answered 13/6, 2015 at 18:48 Comment(0)
C
0

If you are using a version such as 2.1.1, and if you are using a namespace use Pheanstalk\Pheanstalk, then that might be the issue (it was for me). Version 2.1.1 isn't compatible with using namespaces, hence you would delete the use ... line and then, when initiating an instance of class type Pheanstalk, you do it as follows:

$pheanstalkObject = new Pheanstalk_Pheanstalk('127.0.0.1');
Cummine answered 22/5, 2016 at 2:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.