ZeroMQ and PHP-FPM

I just ran into the problem that ZeroMQ in PHP seems to work correctly when used on the command line but not in the FPM process. Has anyone else observed this behavior? Is there a simple solution? Could it be a rights management issue or something else? Unfortunately, there are no error messages at all.


The server is started from the command line:

$context = new ZMQContext;
$socket = new ZMQSocket($context, ZMQ::SOCKET_PULL);
$socket->bind('ipc:///tmp/test.sock');
while (true) echo $socket->recv();

      

Another script is located on my local web server (nginx + php-fpm):

$context = new ZMQContext;
$socket = new ZMQSocket($context, ZMQ::SOCKET_PUSH);
$socket->connect('ipc:///tmp/test.sock');
$socket->send('Test Message');

      

If you execute this script from the command line, the message gets passed to the zmq server without issue. If I execute the script through the browser, nothing happens.

+3


source to share


1 answer


According to zeromq error tickets, this is a known issue, but they have no intention of fixing it:

https://github.com/zeromq/libzmq/issues/48

I also tried changing the permissions as mentioned in other threads (and confirmed that I successfully create them as 0777 when viewed on the filesystem), but no luck with zeromq:



UNIX domain sockets unavailable to users?

I also finally gave up and used TCP.

0


source







All Articles