First of all, yes I am aware that there is a very similar question out there, but the answer given there doesn\'t apply to my situation, and there\'s no indication that it f
I have not used ZMQ but this seems like a configure problem.
Eg in ubuntu 12.04:
/etc/php5/apache2/php.ini is used for apache
/etc/php5/cli/php.ini is used for cli
To check if ZMQ is currently loaded in apache, create a php file contains phpinfo();
and check it's output through web browser, there should be some info about ZMQ, use ctrl-f to search for it.
In cli, php -m
will show loaded/compiled module or extension.
I can't thought other reason than you used a ZMQ version which hasn't ZMQContext ? You could check ZMQ document and the version you used.
if ZMQ is currectly loaded, and your code still doesn't work, the another possible reason is use of namespace. If your post.php is like
<?php
namespace Some\NameSpace;
$context = new ZMQContext();
Then it means ZMQContext in namespace Some\NameSpace, the full quanlified classname is Some\NameSpace\ZMQContext, which doesn't exists. So you may need use \ZMQContext
for class out of current namespace.
If you use Wampserver, copy libzmq.dll
file into C:\wamp64\bin\apache\apache2.4.17\bin
and restart wamp.
If the extension is enabled you still need to use this:
use \ZMQContext;
use \ZMQ;
(or alternatively directly access them using a leading "\")
You need to restart Apache before using new extensions. mod_php doesn't add modules during runtime