Unexpected error when installing WordPress plugins

I was installing civicrm and got an error while trying to install some wp plugin.
When trying to do it manually, I got the same error. It’s been reported by others that this should work.
It happens for all plugins that I’m trying to install

I’m unable to figure out what could be wrong. I tried upgrading openssl and php5-curl as I read that online in some forum. Restarting apache didn’t help either.

Read More

When I go to the “install plugin” page I get the same errors. Changing the timeout in wp-admin/includes/plugin-install.php for the function wp_remote_post() from 15 to 60 made it work. But that’s not good as it’s a core file. Also, themes dont work if I do this.

ajk@ajk-ThinkPad-R60:~/buildkit/build/wpmaster/wp-content/plugins$ wp plugin install civicrm-admin-utilities --debug
Debug: No readable global config found (0.029s)
Debug: Using project config: /home/ajk/Documents/civi/civicrm-buildkit/build/wpmaster/wp-cli.yml (0.034s)
Debug: ABSPATH defined: /home/ajk/Documents/civi/civicrm-buildkit/build/wpmaster/ (0.121s)
Debug: Begin WordPress load (0.121s)
Debug: wp-config.php path: /home/ajk/Documents/civi/civicrm-buildkit/build/wpmaster/wp-config.php (0.122s)
Debug: Loaded WordPress (0.724s)
Debug: Running command: plugin install (0.725s)
PHP Notice:  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 <a href="https://wordpress.org/support/">support forums</a>. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /home/ajk/Documents/civi/civicrm-buildkit/build/wpmaster/wp-admin/includes/plugin-install.php on line 158
PHP Stack trace:
PHP   1. {main}() /home/ajk/Documents/civi/civicrm-buildkit/bin/wp:0
PHP   2. include() /home/ajk/Documents/civi/civicrm-buildkit/bin/wp:4
PHP   3. include() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/boot-phar.php:5
PHP   4. WP_CLIRunner->start() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/wp-cli.php:21
PHP   5. WP_CLIRunner->_run_command() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Runner.php:723
PHP   6. WP_CLIRunner->run_command() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Runner.php:320
PHP   7. WP_CLIDispatcherSubcommand->invoke() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Runner.php:313
PHP   8. call_user_func() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Dispatcher/Subcommand.php:294
PHP   9. WP_CLIDispatcherCommandFactory::WP_CLIDispatcher{closure}() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Dispatcher/Subcommand.php:294
PHP  10. call_user_func() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php:52
PHP  11. Plugin_Command->install() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/Dispatcher/CommandFactory.php:52
PHP  12. WP_CLICommandWithUpgrade->install() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/commands/plugin.php:445
PHP  13. Plugin_Command->install_from_repo() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/WP_CLI/CommandWithUpgrade.php:141
PHP  14. plugins_api() phar:///home/ajk/Documents/civi/civicrm-buildkit/bin/wp/php/commands/plugin.php:297
PHP  15. trigger_error() /home/ajk/Documents/civi/civicrm-buildkit/build/wpmaster/wp-admin/includes/plugin-install.php:158
Warning: civicrm-admin-utilities: 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 <a href="https://wordpress.org/support/">support forums</a>.

Related posts