以下にリストされているコードを実行すると、次のエラーが発生します。PECL を使用して AMQP 拡張機能をインストールしました。コマンド ラインとブラウザーの両方から phpinfo を実行すると、php.ini ファイルに正常に表示されます。
<?php
// amqp rabbitmq client test
// Create a connection
$cnn = new AMQPConnection();
exit();
?>
そのコードを実行しようとすると、次のエラーが発生します。
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
これらは私が従ったインストール手順です:
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