douzhang6496 2015-05-25 04:07
浏览 629
已采纳

未找到“AMQPConnection”类; 已安装AMQP,但未在phpinfo中显示

I am receiving the error:

Fatal error: Class 'AMQPConnection' not found

I have installed it following http://php.net/manual/fa/amqp.installation.php

and:

extension=amqp.so

has been added to the main php.ini file and also the virtualhost's own.

and apache has been restarted.

On phpinfo, amqp appears under "Additional ini files parsed":

/etc/php5/cgi/conf.d/05-opcache.ini, /etc/php5/cgi/conf.d/10-pdo.ini, /etc/php5/cgi/conf.d/20-curl.ini, /etc/php5/cgi/conf.d/20-gd.ini, /etc/php5/cgi/conf.d/20-imap.ini, /etc/php5/cgi/conf.d/20-json.ini, /etc/php5/cgi/conf.d/20-mysql.ini, /etc/php5/cgi/conf.d/20-mysqli.ini, /etc/php5/cgi/conf.d/20-pdo_mysql.ini, /etc/php5/cgi/conf.d/20-readline.ini, /etc/php5/cgi/conf.d/25-amqp.ini

However the main amqp block which should appear under Configuration doesn't exist.

So it's almost like it's installed but not started / installed correctly.

When restarting apache it gives no errors. So I am not sure where to look for any errors / reasons why it might not be starting or loading into phpinfo.

  • 写回答

1条回答 默认 最新

  • dongmao9217 2015-05-29 02:37
    关注

    Solved it.

    I cleared out all the librabbit files that find -iname "rabbit" could find in /usr.

    Reinstalled rabbitmq-c and amqp v 1.6 beta 3

    Then received the error in apacge start up logs:

    PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/amqp.so' - librabbitmq.so.4: cannot open shared object file: No such file or directory in Unknown on line 0

    So it seemingly couldn't find librabbit.so.4 so I created a symlink to where it was looking, restarted apache and the issue is resolved.

    Thanks

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧