WordPress – How to fix unexpected error at theme search

Issue:
Error message “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.”  is displayed at theme or plugin search.

Solution:
This happens due to http request timeout which is defined in class-http.php under wp-include directory. Default timeout (5 seconds) is sometimes too short to load the theme or plugin contents. All you need to do is increase it.

-Open class-http.php

$ sudo vi /var/www/html/wp-includes/class-http.php

-Increase timeout value from 5 to whatever

'timeout' => apply_filters( 'http_request_timeout', 15 ),

-Save class-http.php

5 comments on “WordPress – How to fix unexpected error at theme search
    • Hi Ewan, thanks for visiting my blog.
      As for the answer to your question, I just noticed that you don’t need to restart apache to enact the change. Changing and saving class-http file are enough to make error at theme search go away. Try it. I’ll update my post too.

  1. nice solution. It is very helpful to me solve the issue “An unexpected error occurred. Something may be wrong with your server configuration” when tried to install a new plugin in my website

    solution is
    Open file
    wp-includes/class-http.php
    -Increase timeout value from 5 to whatever
    ‘timeout’ => apply_filters( ‘http_request_timeout’, 50 ),

Leave a Reply

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