Failed to enable crypto stream_socket_client() error after upgrading PHP

I just upgraded the version of PHP on the server running this blog, and popped over to /wp-admin/site-health.php to check for any errors.

There were a few, the main one which caught my eye being The REST API encountered an error.

For the Google results, that error message in text is:

The REST API request failed due to an error.
Error: stream_socket_client(): SSL operation field with code 1. OpenSSL Error messages: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure stream_socket_client(): Failed to enable crypto stream_socket_client(): unable to connect to ssl:// (Unknown error) (http_request_failed)

Eeep, not good – fortunately its a simple fix, as its caused by a missing package. On Debian (or similar), run;

sudo apt-get install php{<em>PHP VERSION</em>}-curl
sudo service apache2 restartCode language: HTML, XML (xml)

Replacing {PHP VERSION} with your newly installed version (e.g. PHP7.4)






3 responses to “Failed to enable crypto stream_socket_client() error after upgrading PHP”

  1. […] and its normally pretty good at finding errors caused by an upgrade – I blogged about the Failed to enable crypto stream_socket_client() error I faced when I upgraded my web server, and that was caused by a missing […]

  2. Florin avatar

    Man, you saved my life, there was no sense in this error I got when trying to register a plugin:)

  3. TheresNoTime avatar

    No worries!

Leave a Reply

Your email address will not be published. Required fields are marked *