# Cannot connect Discourse to WordPress

**URL:** https://meta.discourse.org/t/cannot-connect-discourse-to-wordpress/229073
**Category:** WordPress
**Created:** [June 5, 2022, 5:35pm UTC](https://meta.discourse.org/t/cannot-connect-discourse-to-wordpress/229073 "2022-06-05T17:35:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![CMASFO](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmasfo/32/262678_2.png) [@CMASFO](https://meta.discourse.org/u/CMASFO)
#### Post date: [June 5, 2022, 5:35pm UTC](https://meta.discourse.org/t/cannot-connect-discourse-to-wordpress/229073/1 "2022-06-05T17:35:45Z")

</div>

I made api key, typed url, api, username, and this is what I get from the [WP Discourse](https://github.com/discourse/wp-discourse) plugin.

**You are not connected to Discourse. Check that your connection settings are correct. If the issue persists, enable connection logs and check Logs.**

And this is the log that I get.

[2022-06-05 17:20:38] connection.INFO: check\_connection\_status.failed\_to\_connect {“error”:“wpdc\_response\_error”,“message”:“An invalid response was returned from Discourse”,“http\_code”:“”,“http\_body”:“”}

And sometimes this log.

[2022-06-05 16:14:55] connection.INFO: check\_connection\_status.failed\_to\_connect {“error”:“wpdc\_response\_error”,“message”:“An invalid response was returned from Discourse”,“http\_code”:404,“http\_body”:“\r\n404 Not Found\r\n\r\n\<h1\>404 Not Found\r\n\<hr\>\<center\>nginx\r\n\r\n\r\n”}

I also check curl and this is what I get.

curl: (60) SSL: no alternative certificate subject name matches target host name ‘[cmasfo.com](http://cmasfo.com)’  
More details here: [curl - SSL CA Certificates](https://curl.se/docs/sslcerts.html)

curl failed to verify the legitimacy of the server and therefore could not  
establish a secure connection to it. To learn more about this situation and  
how to fix it, please visit the web page mentioned above.

What should I do in this situation?

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [June 6, 2022, 7:56am UTC](https://meta.discourse.org/t/cannot-connect-discourse-to-wordpress/229073/2 "2022-06-06T07:56:06Z")

</div>

Hey @CMASFO, welcome to meta 🙂

For this kind of issue please see my response here

> [@Changing host for Wordpress, lost connection to Discourse (curl 6 error)](https://meta.discourse.org/t/changing-host-for-wordpress-lost-connection-to-discourse-curl-6-error/192200/7):
>
> Hey Romain, there could be a few different reasons. The reason we recently added [logging infrastructure](https://meta.discourse.org/t/wp-discourse-logging/190745) to the plugin is to directly diagnose these kind of issues. We’ll be adding logging to the connection functionality soon, however it’s only currently active in the publication functionality. A connection issue in the publication logs are unlikely to tell us anything useful. Nevertheless, you did mention an attempt to publish, so please first check the “Logs” admin panel in the WP Discourse p…

In particular:

> I’d recommend you press your hosting provider a bit more, asking them why there’d be an inability to make a `cURL` request to a domain. If they have some more specific reason to think it’s an issue with the [WP Discourse](https://github.com/discourse/wp-discourse) plugin, and not say, an incorrect cURL version on the server (which on the face of it is more likely), they’re welcome to post here, or even pm me, and I’d be happy to look into it further with them.

And

> [@cURL error 35 when trying to connect](https://meta.discourse.org/t/curl-error-35-when-trying-to-connect/57804/12):
>
> You could try installing this plugin: [TLS 1.2 Compatibility Test – WordPress plugin | WordPress.org English (Canada)](https://en-ca.wordpress.org/plugins/tls-1-2-compatibility-test/) It adds an item to the WordPress tools menu that tests you webserver for TLS 1.2 compatibility against a PayPal endpoint. If it works with PayPal it should work with other endpoints as well.

Let me know how you go with those.

---

<div class="post-metadata">

### Author: ![CMASFO](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cmasfo/32/262678_2.png) [@CMASFO](https://meta.discourse.org/u/CMASFO)
#### Post date: [June 6, 2022, 3:56pm UTC](https://meta.discourse.org/t/cannot-connect-discourse-to-wordpress/229073/3 "2022-06-06T15:56:12Z")

</div>

I experienced this problem from 2 environments.

one was bitnami wordpress stack, and the another was aapanel.

so I just tried to install wordpress manually,  
like installing server and database by hand,  
and now it works!

just wonders what the problem was

thx for replying

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [June 6, 2022, 4:03pm UTC](https://meta.discourse.org/t/cannot-connect-discourse-to-wordpress/229073/4 "2022-06-06T16:03:14Z")

</div>

> [@CMASFO](#):
>
> just wonders what the problem was

It was most likely the version of `php-curl` on your server.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 6, 2022, 4:03pm UTC](https://meta.discourse.org/t/cannot-connect-discourse-to-wordpress/229073/5 "2022-07-06T16:03:17Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
