I solved it in XAMPP by uncommenting ;extension=php_openssl.dll
in /apache/bin/php.ini
despite phpinfo() telling me /php/php.ini
was the loaded ini file.
EDIT: I guess Ezra answer is the best solution directly adding the extension line to the appropriate ini file.