Installing RabbitMQ PHP: Fatal error: Class 'AMQPConnection' not found

扶醉桌前 提交于 2019-12-25 08:13:52

问题


I've already installed the RabbitMQ on my server and everything is working fine with it. I already tried to send and receive queued messages with a Java client and everything went perfect.

Now I need to install a PHP RabbitMQ client because I want to communicate a Java program with a PHP webpage, but this time I'm not beign so lucky.

I already followed the steps of the official webpage for this installation, specifically these steps:

# Download the rabbitmq-c library
hg clone http://hg.rabbitmq.com/rabbitmq-c/rev/3c549bb09c16 rabbitmq-c
cd rabbitmq-c
# Add the codegen requirement
hg clone http://hg.rabbitmq.com/rabbitmq-codegen/rev/f8b34141e6cb codegen
# Configure, compile and install
autoreconf -i && ./configure && make && sudo make install 

And actually on the console I can see that it was "installed" without any problems. But when I try to open any AMQP Connection I get this error:

Fatal error: Class 'AMQPConnection' not found

Actually if I use the phpinfo(); command I can't see anything related to an AMQP module (like in this question). So I think that it may be a problem with the installation but I tried reinstalling it two times and it keeps saying that everything went well.

Have anyone crossed with this problem too?


回答1:


Solved it..

The module wasn't being loaded in the right php.ini file. Just added extension=amqp.so at the end of the right php.ini file and restarted Apache.



来源:https://stackoverflow.com/questions/9280879/installing-rabbitmq-php-fatal-error-class-amqpconnection-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!