I am trying to connect to communicate to jupyter server using zmq messages sent by my PHP script. But the connection between zmq server and my PHP script is not being established.
I tried assigning ports in jupyter notebook config which is located at
~/.jupyter/jupyter_notebook_config.py c.NotebookApp.ip = '127.0.0.1'c.NotebookApp.port = 9992c.Session.key = b'00f2400c-bea977d0c80f0'c.ConnectionFileMixin.shell_port = 37971c.ConnectionFileMixin.iopub_port = 36612c.ConnectionFileMixin.control_port = 51091c.ConnectionFileMixin.hb_port = 55613c.NotebookApp.token = '12345'c.ConnectionFileMixin.ip = '0.0.0.0'c.KernelManager.autorestart = True
and the PHP script trying to connect is
<?php// Load the ZMQ extension$context = new ZMQContext();// Create a new socket of type Request (REQ)$socket = $context->getSocket(ZMQ::SOCKET_REQ);// Connect to the server$socket->connect("tcp://127.0.0.1:55613");for ($request = 0; $request < 10; $request++){ echo "Sending request $request...\n"; // Command to send. $socket->send("Heartbeat"); // Get the reply. $reply = $socket->recv(); echo "Received reply $request: [$reply]\n";}
when I connect to the notebook after starting it, no response is coming back from server.