CURL ERROR 7 could not establish a secure connection to WordPress.org

On a WordPress website hosted on a CentOS server, I got the following error on the header of the website.

Warning: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /var/www/html/wp-admin/includes/translation-install.php on line 68

On debugging the code, I found the code returned “CURL ERROR 7”. This happens when the curl connection is blocked. I was able to curl to the URL from the command line.

curl https://api.wordpress.org/translations/core/1.0/

To error is due to SELinux. To fix the error, run the command

setsebool -P httpd_can_network_connect on

Or disable SELinux.

See SELinux, WordPress.

Comments

Leave a Reply

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