Reputation: 9918
I've already seen this question. It suggests that AMQP PECL extension is not installed. However, I have successfully installed both RabbitMQ as well as built PECL AMQP extension. The following is the output of the phpinfo().
You can clearly see, AMQP is loaded correctly. However, when I try to establish a connection, it says PHP Fatal error: Class 'AMQPConnection' not found. Below is the code.
$connection = new AMQPConnection();
And here is the output.
user@ubuntu:~$ php repos/default/test.php
PHP Fatal error: Class 'AMQPConnection' not found in /home/user/repos/default/test.php on line 5
Why this might happen? Any suggestions? Thank you.
Upvotes: 7
Views: 14935
Reputation: 521995
The problem is most likely that the CLI installation uses a different php.ini file than the web/Apache module and you need to add the extension to the CLI php.ini file as well. Where exactly that is depends on your platform.
Upvotes: 5