Opening external urls with php functions

1

When trying to open a url with the function file_get_contents() I get the following error

  

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

Could you help me resolve this error?

When using the phpinfo() function it appears that the OpenSSL support is disabled and you have to download the .dll plus I downloaded it and put it in the directory like the picture below:

    
asked by anonymous 05.08.2017 / 22:39

2 answers

1

Your extensions directory in php.ini may be referencing a wrong relative path, I already had a problem with that.

Try to verify that the "extension_dir" directive is referencing the right location. Try to replace with the absolute address. Ex: extension_dir="C: \ xampp \ php \ ext"

    
06.08.2017 / 21:35
2

This error happens because you have a disabled extension in the php configuration

Open your file php.ini search for this line and remove the ; from the front of this extension, eg:

;extension=php_openssl

changes to:

extension=php_openssl

Save the file edit and restart the server and the error should be corrected.

    
05.08.2017 / 22:44