• Hello,

    Since WP4.6, I have this error “cURL error 52: Empty reply from server.” from the dashboard when I try to update a network.

    This happened on different locations (domains). When WordPress is installed in network mode (multi-site) , after upgrading themes or plugins, when trying to update the network, some site will be correctly updated and often only one site will return this error message.

    Thanks for your help.

Viewing 9 replies - 1 through 9 (of 9 total)
  • What version of PHP are you using?

    Thread Starter HyperTiti

    (@hypertiti)

    Hi Dan,
    Thanks for helping.

    3 domains. All of them displayed this error.

    1 x PHP 5.6.24
    2 x PHP 5.5.38

    After looking through this, I would check web server logs and/or contact your web host to see if they can help.

    Thread Starter HyperTiti

    (@hypertiti)

    Thanks for your reply.

    Well, I’m doubting about a hosting issue. No problem so far until yesterday when I started updating the websites.

    I will wait to see if others have the same issue.

    Thanks.
    Cheers.

    Check the error logs on the server.

    CURLE_GOT_NOTHING (52)
    Nothing was returned from the server, and under the circumstances, getting nothing is considered an error.

    We’ve found this issue to be due to the fact that the Requests class doesn’t explicitly set the “Expect” header which allows cURL to automatically set it to Expect: 100-continue. More information on that here: https://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3

    This seems to cause issues on a small set of servers on the sending side of things that causes large POST requests to pretty much any other server that’s otherwise set up to respond to them to fail. I’m not sure why this happens, but the fix is pretty easy: we just need to explicitly set the “Expect” header before cURL can do so automatically. We can do that with the following filter:

    function preempt_expect_header($r) {
    	$r['headers']['Expect'] = '';
    	return $r;
    }
    add_filter( 'http_request_args', 'preempt_expect_header' );
    • This reply was modified 8 years, 5 months ago by JRGould.

    Where should the above function be added ? In order to solve the problem ?

    Isa d'Or

    (@studio-isidore)

    Hi there,

    I am getting a cURL error 6: Could not resolve host: space.dreamtrasher.com
    When I have subdomains set to true this error occurs for the subdomain only, while the other site dreamtrasher.com/ and dreamtrasher.com/studiotales is updated and can be reached.
    I have php version 7 (can change this to 5.6 or less, but obviously not prefered and not the issue when tested)

    I would also like to know where to add the code to see if it solves my problem ??

    Awesome. Thanks for the filter – it’s exactly what I was looking for! ??

    js.

    • This reply was modified 7 years, 11 months ago by JS Morisset.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘"cURL error 52: Empty reply from server."’ is closed to new replies.