How to open external urls with php functions

Asked

Viewed 463 times

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 help me solve this mistake?


When using the function phpinfo() appears that support for Openssl is disabled and has to download the . dll more I have already downloaded put in the directory as in the photo below: inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

  • To see the allowed connection types, run the script: echo '<pre>'; var_dump(stream_get_wrappers()); echo '</pre>';

  • tries to make phpinfo() and shows the enabled extensions

  • Openssl support - disabled (install ext/openssl)

  • Wrong version of DLL most likely. If you are sure it is enabled on . ini and the version is correct, click [Edit] and add more details to the question. If the problem is the . ini, would be the case to indicate which answer solved. As it is, I believe that the problem can not be reproduced (at least by the current statement).

2 answers

2

That mistake happens because you have an extension deactivated in php configuration

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

;extension=php_openssl

mute to:

extension=php_openssl

Saves file editing and restarts the server and the error must be corrected.

  • Did not work gave Not found php_openssl.dll

  • try to download the dll and put it in the extension directory

  • <b>Warning</b>: PHP Startup: Unable to load Dynamic library 'C: php ext php_openssl.dll' - %1 n o a Win32 application v read. in <b>Unknown</b> on line <b>0</b><br /> appears the following error

  • went down and continued

  • @Leonecerqueira dll of the wrong version or architecture would be interesting to check and download the correct

  • @Leonecerqueira also checks if you downloaded the dll for windows and not for linux...

Show 1 more comment

1


Your extension directory in php.ini might be referencing a wrong relative path, I’ve had a problem with that.

Try to check if the "extension_dir" directive is referencing the right location. Try replacing it with the absolute address. E.g.: extension_dir="C: xampp php ext"

Browser other questions tagged

You are not signed in. Login or sign up in order to post.