Answer the question
In order to leave comments, you need to log in
Can't connect to RabbitMQ in PHP
The essence of the problem: when connecting to the Rabbit server, the script throws out an error:
php: symbol lookup error: /usr/local/lib/php/extensions/no-debug-non-zts-20090626/amqp.so: undefined symbol: amqp_open_socket
The library file is present /usr/local/lib/php/extensions/no-debug-non-zts-20090626/amqp.so. The librabbitmq library is installed on the system.
Code that triggers the error:
try
{
$Connection = new AMQPConnection();
$Connection->setLogin('login');
$Connection->setPassword('password');
$Connection->setVhost('host');
$Connection->setHost('localhost');
$Connection->setPort(5672);
$Connection->connect();
}
catch (\Exception $e)
{
echo 'Ошибка: ' . $e->getMessage();
}
$ nm -D /usr/local/lib/php/extensions/no-debug-non-zts-20090626/amqp.so | fgrep amqp_open_socket
U amqp_open_socket
$ sudo netstat -anlp | grep 5672
tcp 0 0 127.0.0.1:5672 0.0.0.0:* LISTEN 16772/beam.smp
$ php -c /usr/local/var/run/php.ini -m
[PHP Modules]
amqp
Core
ctype
curl
date
dom
ereg
fileinfo
filter
gd
hash
iconv
json
libxml
mbstring
mysql
mysqlnd
pcntl
pcre
PDO
pdo_cubrid
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
shmop
SimpleXML
soap
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question