• The update to WP 4.6 went fine on several sites. We updated all our plugins and themes BEFORE the update. Then updated to WP 4.6. Everything seemed to work.

    Until, additional plugins and/or themese started to need updates. We try to run the updates and we get some variation of this error:

    An error occurred while updating Easy Updates Manager: Download failed. cURL error 23: Failed writing body (667 != 784)

    So we’ve gone through the standard procedures, disabled all plugins, switched to 2016 theme, and did a manual reupload of WP 4.6. But we still can not update any themes or plugsin. AND we can’t seem to install anything “new” via the dashboard.

    We can manually FTP upload plugin updates, etc. But the dashboard won’t work for these common tasks.

    One other odd thing…. under the home dashboard – if we view WordPress News – we also can not get the RSS feed… we get a similar cURL error message

    RSS Error: WP HTTP Error: cURL error 23: Failed writing header

    RSS Error: WP HTTP Error: cURL error 23: Failed writing body (871 != 883)

    Any help would be greatly appreciated.

Viewing 15 replies - 16 through 30 (of 40 total)
  • Thread Starter williamlevins

    (@williamlevins)

    In addition to adding curl_exec to your disable functions under your php.ini or php setup – you do have to apply the core code fix mentioned here – https://www.ads-software.com/support/topic/read-this-first-wordpress-46-master-list?replies=5&view=all#post-8770164 and originally pointed out above by Marius L. J. (Clorith)

    Moderator Marius L. J.

    (@clorith)

    @taba1933 your cURL version is very outdated, you’ll want to ask your host to update that, it’s a 4 year old version (the latest version is 7.50.1, of course they may not be able to jump straight to that, but 7.26 should definitely be updated).

    I wouldn’t recommend downgrading, and if you do, you should be bringing in backups of the database and everything, not just downgrading the files as databases etc often change on upgrade.

    @williamlevins I unfortunately don’t know your cURL version, but I’d highly recommend checking the versioning of it as well (cURL is definitely the preferred way of fetching content so if it can be used that’s always a plus)

    Problem solved for now. I just killed curl_exec (and others) in php.ini like williamlevins adviced and replaced AND with OR in cURL.php. Updating and downloading plugins possible again. Only, now I get these two messages from WordPress News:

    RSS-fout: This XML document is invalid, likely due to invalid characters. XML error: Not well-formed (invalid token) at line 1, column 1

    RSS-fout: This XML document is invalid, likely due to invalid characters. XML error: Not well-formed (invalid token) at line 1, column 1

    Maybe you could look into that.

    Thanx anyway for your concern.

    PS I will ask my host why they maintain such an old version. Nevertheless, in the Netherlands they are known as the most safe…

    Moderator Yui

    (@fierevere)

    永子

    Problem solved for now. I just killed curl_exec (and others) in php.ini

    You made a fallback to fsockopen() transport, however it will be interesting to find roots of the problem and solve it for others having similar issue.
    If updating curl and (possibly) openssl helps then it might be older curl bug having problems with SSLv3 preferred over TLS1.0(+)

    I have a shared hosting so I cannot change PHP.ini to remove curl.

    Change /wp-incldues/Request/Transport/cURL.php from:

    public static function test($capabilities = array()) {

    to

    public static function test($capabilities = array()) {
      return false;

    Now updates are working again.

    Jamie

    (@scragglydoggames)

    I’m having a similar problem today as well across several sites, affecting all plugins and themes.

    My error is slightly different, and I can’t find any topics mentioning it, but this thread is very similar.

    My error is

    Update Failed: Download failed. Response could not be parsed

    When trying to do the updates, and then the themes/plugins disappear from my plugin list. I’ve reported this thread to my host, and will see if it’s also an issue that gets fixed by this

    So, how to fix it?
    Host provider said they have enabled curl and I have php 5.6 (7 – they don’t have)
    But problem still exist.
    How to fix it?
    I can’t update plugins and themes!

    Jamie

    (@scragglydoggames)

    I reported this thread to my host. They updated something, asked me to reinstall WordPress which I did on 4 sites and seems to fix the problem for me.

    So do a reinstall of WordPress core after the fix, then try again

    Thread Starter williamlevins

    (@williamlevins)

    @fcostacampos – nice fix. That actually works! And it solves some latent issues I was having due to curl_exec being disabled.

    So to summarize…

    1) Edit /wp-incldues/Request/Transport/cURL.php

    2) Around line 526 – per fcostacampos – add return false;

    public static function test($capabilities = array()) {
      return false;

    3) Changed && to || according to Marius suggestion – read more here – https://www.ads-software.com/support/topic/read-this-first-wordpress-46-master-list?replies=5&view=all#post-8770164 – not sure if this is still necessary but meh, shouldn’t hurt.

    So my final edit to the public function in cURL.php looks like this

    public static function test($capabilities = array()) {
    		return false;
    		if (!function_exists('curl_init') || !function_exists('curl_exec')) {
    			return false;
    		}
    
    		// If needed, check that our installed curl version supports SSL
    		if (isset($capabilities['ssl']) && $capabilities['ssl']) {
    			$curl_version = curl_version();
    			if (!(CURL_VERSION_SSL & $curl_version['features'])) {
    				return false;
    			}
    		}
    
    		return true;
    	}

    Moderator Marius L. J.

    (@clorith)

    @williamlevins
    That change will go away with the next WordPress update, we generally don’t recommend editing core files directly unless it’s something we know is already patched and will be included in an update.

    Did you check the cURL version available to you, as some older versions are known to have issues with secure (https/ssl) connections in some situations.

    @scragglydoggames
    Glad to hear you got it sorted out!

    @l575
    You’re going to have to confirm the version of cURL installed, and if any curl_* functions have been disabled by your host.

    cURL support: enabled
    cURL Information: 7.36.0
    Age: 3
    AsynchDNS: Yes
    CharConv No
    Debug No
    GSS-Negotiate Yes
    IDN Yes
    IPv6 Yes
    krb4 No
    Largefile Yes
    libz Yes
    NTLM Yes
    NTLMWB Yes
    SPNEGO No
    SSL Yes
    SSPI No
    TLS-SRP No
    Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp
    Host x86_64-redhat-linux-gnu
    SSL Version OpenSSL/1.0.1e
    ZLib Version 1.2.3
    libSSH Version libssh2/1.4.3

    Moderator Marius L. J.

    (@clorith)

    @l575
    I can’t say for sure if this is related, but I’d like to get it addressed any way, you’ll need to talk to your host, but your OpenSSL version is outdated an on a known vulnerable version known as Heartbleed, the cURL version is a few years old, so if it’s possible to bring that up to date that’d be awesome, just ot make sure that’s also not a factor in things not working ??

    I am also having an update issue with 4.6.

    I have started a site on Google Cloud and installed the single instance.
    Having removed the plugins installed by default leaving a theme I get an unpacking error when applying the update

    The update could not be unpacked

    Installation Failed

    is returned.

    I would appreciate any suggestions.
    I do not do code unless it is really simple and relatively new to Google Cloud.

    Alex

    Thread Starter williamlevins

    (@williamlevins)

    Alas, WordPress 4.6.1 update failed to permanently fix the Curl Issue. It actually causes the problem to re-occur. While I had hoped the problem would be solved – it remains – UNLESS I re-edit /wp-incldues/Request/Transport/cURL.php – as I outline on the page 2 of this thread.

    The wordpress team DID fix the && vs || issue – BUT I still must put the return false; addition or cURL fails.

    I really don’t want to keep editing a core file that I KNOW will be overwritten on the next update to WP – but the cURL issue lingers so it’s my only option at this time.

    I hope someone finds a permanent solution to this or the wonderful WP team fixes things.

    public static function test($capabilities = array()) {
    		return false;  //<---- I must add this or cURL fails
    
    		if (!function_exists('curl_init') || !function_exists('curl_exec')) {
    			return false;
    		}
    
    		// If needed, check that our installed curl version supports SSL
    		if (isset($capabilities['ssl']) && $capabilities['ssl']) {
    			$curl_version = curl_version();
    			if (!(CURL_VERSION_SSL & $curl_version['features'])) {
    				return false;
    			}
    		}
    
    		return true;
    	}

    You still are using 4.6.1 correct?

Viewing 15 replies - 16 through 30 (of 40 total)
  • The topic ‘After Update to 4.6 keep getting cURL error 23’ is closed to new replies.