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?

Alister Bulman
  • 34,482
  • 9
  • 71
  • 110
Anthony
  • 5,275
  • 11
  • 50
  • 86

4 Answers4

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

Jerome Jaglale
  • 1,863
  • 18
  • 22
2

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

Anthony
  • 5,275
  • 11
  • 50
  • 86
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"
Bouke Versteegh
  • 4,097
  • 1
  • 39
  • 35
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');
Webeng
  • 7,050
  • 4
  • 31
  • 59