Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14115

Message: file_get_contents(): https:// wrapper is disabled in the server configuratio

$
0
0
I am trying below code to get city detail from thirdparty website using one of my controller file


PHP Code:
$arrContextOptions=array( "ssl"=>array( "verify_peer"=>false"verify_peer_name"=>false, ), );
$target_url "https://ziptasticapi.com/{$zip}";
$cityInfo file_get_contents($target_urlFILE_USE_INCLUDE_PATH); 


But I am getting below errors, I already tried allow_url_fopen = On & allow_url_include = On in php.ini file, it getting issue with php7.0 while I am using php 5.6 It works fine. So please let me guide its codeigniter issue or server? I am using same above code in external file than it works fine, but while I am using above code with controller it gives error with php7.0.

Quote:Severity: Warning
Message: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0
Filename: controllers/Quotes.php
Line Number: 283

Backtrace:

File: /home/wprcf/public_html/admin/application/controllers/Quotes.php
Line: 283
Function: file_get_contents

File: /home/wprcf/public_html/admin/index.php
Line: 315
Function: require_once

A PHP Error was encountered
Severity: Warning
Message: file_get_contents(https://ziptasticapi.com/46220): failed to open stream: no suitable wrapper could be found
Filename: controllers/Quotes.php
Line Number: 283

Backtrace:

File: /home/wprcf/public_html/admin/application/controllers/Quotes.php
Line: 283
Function: file_get_contents

File: /home/wprcf/public_html/admin/index.php
Line: 315
Function: require_once

Viewing all articles
Browse latest Browse all 14115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>