title: ZeroMQ send/receive on PHP works if script launched from CLI/shell but not from APACHE/web request
body: <p>I'm testing ZeroMQ for PHP. My goal is to send messages to a Python script.
  Everything works fine if i launch my transmission script from PHP cli</p>
  
  <pre><code>php /path/to/myscript.php
  </code></pre>
  
  <p>while it fails if it's a web request. I've tried executing the server script from PHP cli as above (which seems to be the more logical way) and with a web request.</p>
  
  <p>I've got a Centos 7 server with PHP 7.2 and ZeroMQ 1.1.3 installed through PECL install.</p>
  
  <p>I even tried launching the above command with shell_exec/exec inside the client script but it doesn't work. Connection works fine, but it doesn't send nor receive.</p>
  
  <p>Client code:</p>
  
  <pre><code>$context = new ZMQContext();
  
  //  Socket to talk to server
  echo "Connecting to hello world server...\n";
  $requester = new ZMQSocket($context, ZMQ::SOCKET_REQ);
  $currentObject = $requester-&gt;connect("tcp://localhost:5555");
  
  
  for ($request_nbr = 0; $request_nbr != 10; $request_nbr++) {
      printf ("Sending request %d...\n", $request_nbr);
      $risSend = $requester-&gt;send("Hello", ZMQ::MODE_NOBLOCK);
      print_r($risSend);
      $reply = $requester-&gt;recv();
      printf ("Received reply %d: [%s]\n", $request_nbr, $reply);
  }
  </code></pre>
  
  <p>Server Code:</p>
  
  <pre><code>$context = new ZMQContext(1);
  
  //  Socket to talk to clients
  $responder = new ZMQSocket($context, ZMQ::SOCKET_REP);
  $responder-&gt;bind("tcp://*:5555");
  
  while (true) {
      //  Wait for next request from client
      $request = $responder-&gt;recv();
  
      printf ("Received request: [%s]\n", $request);
  
      //  Send reply back to client
      $responder-&gt;send("World");
  }
  </code></pre>
  
  <p>The browser gets stuck, without any error. Even using a timeout it reaches the limit and exits but I can't get any error message.</p>