I have installed mosquitto broker on a centos server. for communication I installed Mosquitto-PHP library. publisher and subscriber are working fine on the same server but when I am trying to publish message from this centos server and running subscriber code from local machine ubuntu then getting following error -
PHP Fatal error: Uncaught Mosquitto\Exception: The client is not currently connected. in /home/sujit/Desktop/php_test.php:12
Stack trace:
I have installed mosquitto broker on a centos server. for communication I installed Mosquitto-PHP library. publisher and subscriber are working fine on the same server but when I am trying to publish message from this centos server and running subscriber code from local machine ubuntu then getting following error -
PHP Fatal error: Uncaught Mosquitto\Exception: The client is not currently connected. in /home/sujit/Desktop/php_test.php:12 Stack trace:
0 /home/sujit/Desktop/php_test.php(12): Mosquitto\Client->subscribe('#', 1)
1 {main}
thrown in /home/sujit/Desktop/php_test.php on line 12
Mosquitto-PHP library installed on local server.