# Cannot connect using phpMQTT

**URL:** <https://community.hivemq.com/t/cannot-connect-using-phpmqtt/1593>\
**Category:** HiveMQ Community Edition\
**Created:** [November 15, 2022, 12:58pm UTC](https://community.hivemq.com/t/cannot-connect-using-phpmqtt/1593 "2022-11-15T12:58:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![csg](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/csg/32/464_2.png) [@csg](https://community.hivemq.com/u/csg)\
**Post date:** [November 15, 2022, 12:58pm UTC](https://community.hivemq.com/t/cannot-connect-using-phpmqtt/1593/1 "2022-11-15T12:58:09Z")

</div>

I am attempting to connect with phpMQTT ( [bluerhinos/phpMQTT](https://github.com/bluerhinos/phpMQTT)) to the free version of HiveMQ Cloud. I have experimented with multiple variants of certificates but cannot get it to connect to HiveMQ. Fails every time (with no error code unfortunately).

I see here [Ssl: certificate\_verify\_failed](https://community.hivemq.com/t/ssl-certificate-verify-failed/740/2), that there may be trust issue with the certificates… would this effect phpMQTT?

Could someone walk me through the steps to produce the correct cert file for the free HiveMQ version and how to properly use it to connect from phpMQTT.

Thanks 🙂

Env - PHP8.0 on Linux  
Dev - Win 10

---

<div class="post-metadata">

**Author:** ![Daria\_H](https://avatars.discourse-cdn.com/v4/letter/d/dfb087/32.png) [@Daria\_H](https://community.hivemq.com/u/Daria_H)\
**Post date:** [November 15, 2022, 1:15pm UTC](https://community.hivemq.com/t/cannot-connect-using-phpmqtt/1593/2 "2022-11-15T13:15:53Z")

</div>

Hi @csg ,

Great that you are interested in MQTT and HiveMQ, welcome to the community 👋

You can download the root certificate [here](https://community.hivemq.com/t/frequently-asked-questions/514).

I hope this helps.

Best,  
Dasha from HiveMQ Team

---

<div class="post-metadata">

**Author:** ![csg](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/csg/32/464_2.png) [@csg](https://community.hivemq.com/u/csg)\
**Post date:** [November 15, 2022, 1:29pm UTC](https://community.hivemq.com/t/cannot-connect-using-phpmqtt/1593/3 "2022-11-15T13:29:43Z")

</div>

Hi - thanks for the quick response. The FAQ has quite a few posts about certs and I have followed a number of them in attempts to get the correct cert. Can you point me to the specific FAQ post that is the right one and should work? Thanks

---

<div class="post-metadata">

**Author:** ![csg](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.hivemq.com/csg/32/464_2.png) [@csg](https://community.hivemq.com/u/csg)\
**Post date:** [November 15, 2022, 1:35pm UTC](https://community.hivemq.com/t/cannot-connect-using-phpmqtt/1593/4 "2022-11-15T13:35:37Z")

</div>

I looked again and found another link in the FAQ … that one worked this time.

Thank you 🙂
