Php always gets the public account access_token. what should I do? Who can help me? I can't get the access_token all the time. I can put this url in the browser and return it normally. for example, why can't I do anything?
Reply to discussion (solution)
What is the data returned by file_get and what error is prompted?
In fact, it is not recommended that you directly use file_get-contents
Curl is recommended.
What is the data returned by file_get and what error is prompted?
In IE browser, the returned value is normal, but I don't know why I used file_get to return null?
Use curl.
Use curl.
How to use it, like file_get-contents (http://www.bjp51.net) directly submit it
After I use this method to submit and return bool (false), what is my code wrong?
function _Curl($url) {$ch = curl_init();curl_setopt($ch, CURLOPT_TIMEOUT, 5);curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);$dataBlock = curl_exec($ch);curl_close($ch);return $dataBlock;}
To use CURL, first determine whether you have installed curl to expand phpinfo () and check whether there is a curl module.
If yes, use get.
Function get_curl ($ url ){
$ Ch = curl_init ();
Curl_setopt ($ ch, CURLOPT_URL, $ url );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );
Curl_setopt ($ ch, CURLOPT_HEADER, 0 );
$ Return_get = curl_exec ($ ch );
Curl_close ($ ch );
Return $ return_get;
}
Have you installed curl?
I found the cause is a server problem.
Is there a problem with the server ??
I found it was a server problem. it would be nice to change the server.