[英]Unable to install AMQP for PHP - Symbol not found error
I'm getting the following error when running the code listed below. 运行下面列出的代码时出现以下错误。 I have install AMQP extension through PECL and it shows up fine in my php.ini file when I do phpinfo both from the command line and browser. 我已经通过PECL安装了AMQP扩展名,当我从命令行和浏览器执行phpinfo时,它在我的php.ini文件中显示得很好。
<?php
// amqp rabbitmq client test
// Create a connection
$cnn = new AMQPConnection();
exit();
?>
When trying to run that code I get this error: 尝试运行该代码时,出现以下错误:
dyld: lazy symbol binding failed: Symbol not found: _amqp_new_connection
Referenced from: /opt/local/lib/php/extensions/no-debug-non-zts-20090626/amqp.so
Expected in: flat namespace
dyld: Symbol not found: _amqp_new_connection
Referenced from: /opt/local/lib/php/extensions/no-debug-non-zts-20090626/amqp.so
Expected in: flat namespace
These are the install instructions I followed: 这些是我遵循的安装说明:
Download rabbitmq-c lib from: http://hg.rabbitmq.com/rabbitmq-c/ (.zip file)
Download codegen http://hg.rabbitmq.com/rabbitmq-codegen/summary (.zip file)
unzip rabbitmq-c
unzip codegen and put it into the rabbitmq-c lib and rename it codegen
cd into rabbitmq-c dir
autoreconf -i && ./configure && make && sudo make install
#install the amqp extension
sudo pecl install -f amqp
make sure that librabbitmq is compiled as 32bit (if php is 32bit). 确保librabbitmq编译为32位(如果php是32位)。 That helped for me. 那对我有帮助。
To compile in 32 bit, use ./configure CFLAGS="-m32" when compiling librabbitmq and the pecl amqp extension. 要以32位编译,请在编译librabbitmq和pecl amqp扩展名时使用./configure CFLAGS =“-m32”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.