WAMP64 ssl for file_get_contents

404 Views Asked by At

I have a php file that i want to pars something from wiki.

The code is:

file_get_contents("https://en.wikipedia.org/w/api.php?format=json&action=parse");

I constantly get the error:

file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?

By searchin google I finde a lot of commets telling "you have to activate or uncoment openssl_extension in wamp."

This is clearly activated:

SEE Screenshot that proofs this is activated

Can someone help me to get rid of this error?

1

There are 1 best solutions below

2
On

Create a file called phpinfo.php and put this in it:

<?php phpinfo(); ?>

and then browse to that file. You'll see a big list of all your php settings and installed modules. Look for the openssl module and check that it's enabled. If it's not, you need to keep tweaking your WAMP environment until you can see that the module is appearing. Normally when changing Apache/php settings you need to restart Apache for the changes to be taken into account, so you may need restart your WAMP server.