0

When I check my pinfo page I have allow_url_fopen Onenter image description here

But when I try to do

  $url = 'https://www.google.com/recaptcha/api/siteverify';
  $response = file_get_contents($url, false, $context);

I have the warning

<b>Warning</b>:  file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in

What I did wrong ?

Thanks for your help

Chris
  • 435
  • 1
  • 8
  • 21
  • 1
    It sounds like maybe your pinfo page is wrong :( SUGGESTION: Create a dummy "tmp.php" file in the same directory as your application, with the single line ``, and see if you get *different* results. I suspect "info" will say "allow_url_fopen=0". Also double check your server's [php.ini](https://www.php.net/manual/en/configuration.file.php) – paulsm4 Aug 23 '20 at 19:10
  • paulsm4 : You right... in the directory phpinfo return allow_url_fopen Off !!! What I need to do ? Thanks – Chris Aug 23 '20 at 19:45
  • Q: So what does your [php.ini](https://www.php.net/manual/en/configuration.file.php) say? NOTE: it's possible your system might have *multiple* php.ini files. Read the link I gave; check every possible search path. PS: I don't know what your "pinfo" page is, or where it's reading configuration from. Only that I wouldn't "trust" it :) – paulsm4 Aug 23 '20 at 20:52
  • paulsm4 : Thank for your answer. On the root my phpinfo say Loaded Configuration File /home/my_site/public_html/php.ini and allow_url_fopen is On. On the directory it looks like the php.ini is overwrite by /opt/cpanel/ea-php72/root/etc/php.ini !!! I'm going to try to understand why in a directory I load another php.ini and not the one on the root. – Chris Aug 23 '20 at 21:28
  • paulsm4 : I made the change in WHM >> Home >> Software >> MultiPHP INI Editor and that works ;)) Thanks for your help. I still don't know why in a directory I'm not using the same php.ini than the root directory. – Chris Aug 23 '20 at 21:42

0 Answers0