• I am developping a website on localhost, windows, no docker, it works with nginx and wordpress. I need to do a complex page, I decided to use ReactJs and call wordpress API with it to get the info from my MySQL database. Knowing that I use my own DB/tables, I need to add endpoints to WP REST API in PHP.

    I had some trouble making that work, then I found out that the issue could come from the fact that in “Site Health” section I have both “The REST API encountered an error” and “Your site could not complete a loopback request” because of “Error: cURL error 28: Operation timed out after 10004 milliseconds with 0 bytes received .

    I basically tried EVERYTHING (clean install, old versions of php and WP, raising timeout time, I don’t have themes nor plugins, and probably a lot of other things) , I have no ssl for now since I’m on localhost so I don’t care.

    Ask me for any precision and I’ll give them to you, I’m desperate and tired ‘since I’ve been on this for more than a week (yes I’m almost ashamed by now)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Have you gone through the tips here yet?
    https://www.wpbeginner.com/wp-tutorials/how-to-fix-curl-error-28-connection-timed-out-after-x-milliseconds/

    If so, I would recommend you to contact your hoster as it can also be a security setting or misconfiguration there.

    Thread Starter leocrabe225

    (@leocrabe225)

    -I have no Firewall plugin since I am on localhost for now
    -I don’t see how can the DNS interfere with a localhost install
    -I’ve tried to up timeout to 60 seconds, didn’t help
    -I’m not using https/ssl currently so I don’t see how that can be the issue

    So yeah I’ve probably already gone through a tips list that looked a lot like that. And I have no hoster since this is a localhost install

    Does somebody has anything else in mind?

    You are local, but work there with a domain? Do you have a local VM, Docker or XAMPP/MAMP?

    Why I ask this: when you work locally with a domain, your own system as well as the one on which the application is running must have the domain pointed to the correct IP via DNS.
    Example: if I use example.com as WordPress URL, I make example.com point to the IP of my VM via hosts file. Inside the VM I have to resolve the domain to itself as well. For Linux based VMs this is easily done via /etc/hosts. Without this the installed WordPress would not be able to send a request to the domain, because the system does not resolve the IP of the domain or resolves it incorrectly.

    Thread Starter leocrabe225

    (@leocrabe225)

    I have no Docker as stated above, not working from inside a VM, just a bare Windows. Unless I made a mistake somewhere, I’m accessing everything locally.

    This is the endpoint it tries to reach : “https://localhost/wordpress/wp-json/wp/v2/types/post?context=edit”
    What’s weird is that when I try to reach it with a GET from the browser I get 401 forbidden, so it works.
    And when I remove the “?context=edit” -> “https://localhost/wordpress/wp-json/wp/v2/types/post” (still in the browser) I get the posts list

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Site Health cURL error 28’ is closed to new replies.