Sometimes using IP 127.0.0.1 works instead of localhost (in wp-config.php). If WordPress is running fine otherwise ignore these 2 problems if you can not handle them. Rather download the plugins, themes manually using web browser and install them through upload function on your localhost WordPress admin panel or unzip them in plugins or themes folder and activate from WordPress admin panel.
By the way, there is a free Software named AMPPS, it gives a cPanel or Plesk like backend. That might make you a bit easy to handle the emulated server side.