Back to Community

Fixing 'WordPress Could Not Establish a Secure Connection' on Localhost

28 threads Sep 7, 2025 CoreLocalhost installs

Content

If you're developing on a local server like XAMPP, Laragon, or WAMP, you've likely encountered this frustrating error message: Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration... (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.)

This error prevents you from browsing, installing, or updating plugins and themes directly from your WordPress dashboard. Based on numerous community reports, this is a common localhost configuration issue, not a problem with WordPress.org. This guide will walk you through the most effective solutions.

Why This Happens on Localhost

Your local development environment (e.g., XAMPP, Laragon, WAMP) needs to be configured correctly to allow WordPress to make outbound secure (HTTPS) requests to api.wordpress.org. The error typically occurs when the required PHP extensions for these requests are missing, disabled, or misconfigured.

Most Common Solutions

1. Enable and Verify PHP cURL & OpenSSL Extensions

The vast majority of these connection errors are due to the cURL extension not being active. This is essential for WordPress to communicate with external servers.

  • Locate your php.ini file. This is usually found in your local server's PHP directory (e.g., C:xamppphpphp.ini or C:laragonbinphpphp-[version]php.ini).
  • Open the file in a text editor and search for the following lines:
    ;extension=curl
    ;extension=openssl
  • Remove the semicolon (;) from the beginning of each line to enable them. They should look like this:
    extension=curl
    extension=openssl
  • Save the php.ini file and restart your local server (Apache, MySQL) completely.
  • Verify the extensions are loaded by creating a phpinfo.php file in your root directory with the code <?php phpinfo(); ?>. Access it in your browser (e.g., http://localhost/phpinfo.php) and search for 'curl'.

2. Check for External Connection Blocking (Less Common)

Some users have tried adding define('WP_HTTP_BLOCK_EXTERNAL', true); to their wp-config.php file for other reasons, which blocks all external HTTP requests. Ensure this line is not present in your configuration, or if it is, set it to false.

3. Increase PHP's Execution Time (For Timeout Errors)

If your error is accompanied by Fatal error: Maximum execution time of 30 seconds exceeded, your server is timing out while trying to connect. Increase the time limit in your php.ini file.

  • Find and modify these values in php.ini:
    max_execution_time = 120
    max_input_time = 120
  • Save the file and restart your server.

4. Manual Installation: A Reliable Workaround

If configuration changes prove difficult, you can always install plugins and themes manually. This is a reliable fallback method for local development.

  1. Download the plugin or theme ZIP file from WordPress.org.
  2. Extract the ZIP file.
  3. Copy the extracted folder into your WordPress installation's wp-content/plugins or wp-content/themes directory.
  4. Go to your WordPress admin dashboard under Plugins or Appearance > Themes to activate it.

Conclusion

In most cases, the 'secure connection' error on localhost is resolved by simply enabling the PHP cURL extension. If you continue to experience issues, the manual installation method is an effective way to continue your work without interruption. For further reading, the official PHP documentation on installing cURL is an excellent resource.

Related Support Threads Support