php-zmq | ZeroMQ PHP - PHP bindings | Web Framework library
kandi X-RAY | php-zmq Summary
kandi X-RAY | php-zmq Summary
PHP bindings for 0MQ. The documentation is available at
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of php-zmq
php-zmq Key Features
php-zmq Examples and Code Snippets
Community Discussions
Trending Discussions on php-zmq
QUESTION
I have PHP GD installed and enabled:
...ANSWER
Answered 2018-May-25 at 13:07QUESTION
I tried to install ZMQ for PHP recently and ran into the following problem:
apache2: Syntax error on line 137 of /etc/apache2/httpd.conf: Cannot load modules/extra_zmq.so into server: /usr/lib64/apache2/modules/extra_zmq.so: undefined symbol: zend_new_interned_string
- I followed the steps to install 0mq and everything went fine: http://www.zeromq.org/intro:get-the-software
- I ran needed commands to make php-zmq: http://zeromq.org/bindings:php
- Just to be sure I configured with php config set: phpize && ./configure --with-php-config=/usr/bin/php-config
make test on php-zmq shows my PHP version is used (7.1.11, along with Zend 3.1.0) and fail for these two tests (don't know if it's related, I couldn't find more information about these tests):
...ANSWER
Answered 2017-Dec-18 at 16:45Well I found the problem, the extension was meant to be loaded by PHP and not by Apache. I was trying to use LoadModule (a2enmod) in httpd.conf, but this extension needs to be used with PHP, with the proper directive: extension=zmq.so.
QUESTION
I'm developing with PHP 7.0 and I have tried to use the function utf8_encode() and I have got the error "Call to undefined function utf8_encode()"
I have to try to install php7.0-xml module with sudo apt-get install php7.0-xml and I get this error:
...ANSWER
Answered 2017-May-11 at 23:41Do not use the utf8_encode()
or utf8_decode()
functions. They have misleading names -- they actually perform conversions between ISO-8859-1 and UTF-8. In most situations, they should not be necessary; your database and application should use UTF-8 text throughout, and should never deal with ISO-8859-1 text at all.
If you actually need to convert text from ISO-8859-1 to UTF-8 -- which is what utf8_encode()
does -- use the iconv()
function:
QUESTION
I have a small websocket server, running on top of a set of libraries:
- ReactPHP,
- Ratchet
and
- ZeroMQ, using a
php-zmq
wrapper.
The code is basically the same as in the tutorials.
The eventloop starts correctly, users are able to connect to the server, they are getting correct messages, when the other side pushes something, but after a while, usually a few days (depending on the usage) the messages stop arriving.
The usage is not overwhelming at all - only one or two frontend developers connect at the moment, as this is a development stage.
The loop is running, it returns HTTP 101 Switching protocols on connect correctly, but does not broadcast messages that were correctly broadcast before. No errors anywhere. Restarting the event loop helps.
My questions are:1) What can cause this? Has someone encountered similar behaviour?
2) Can you recommend a way I could debug this in long running process of the event loop?
Currently, I must stop the loop, change the code (add logging calls), restart the loop again and wait for it to go wrong again, which is tedious at least.
Any help greatly appreciated.
...ANSWER
Answered 2017-Mar-21 at 13:22Well, I guess the ZMQ was the culprit.
When there were multiple applications using ZMQ on the same machine, messages sometimes ended up in the wrong consumer - even though every application had a different port specified for connection to ZMQ sockets.
So users were sometimes getting websocket frames from a completely different application, and when there was no corresponding user for the message, the frame vanished on the way. So websockets didn't stop broadcasting, messages were just routed incorrectly.
I have no larger knowledge of ZMQ and whether this is a documented or otherwise known behaviour.
I solved the problem by rewriting the backend to RabbitMQ with a separate vhost and channel for every application. The problems are gone now, every frame ends up where it should.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install php-zmq
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page