PHP file_get_contents function error problem

This function file_get_contents php crawl data solutions to common errors

Method one: Locate the php.ini file, modified as follows:

1, the line extension = php_openssl.dll found, remove the front of ';'

2, find allow_url_include = Off the line, will be changed to Off On, and then restart the server.

Method two: the same, and then found php.ini user_agent = "PHP" this line, remove the front ';', restart the server. If you still can not be resolved, then this line is replaced with: user_agent = "Mozilla / 4.0 (compatible; MSIE 6.0; Windows NT 5.0)", restart the server.

Method three: add the following code in your code:

$result  = file_get_contents($reqData['formUrl'], false, $context);
$results = iconv("utf-8", "utf-8//IGNORE",$result);

  

Guess you like

Origin www.cnblogs.com/cnn2017/p/11369639.html