file_get_contents() “failed to open stream: Network is unreachable” error on valid link
问题 There's an extremely simple example of using Youtube API in php that somehow fails to work in my case, and I couldn't find a definitive solution for. I desire to use the Youtube API without any wrapper, by myself, to get data of videos. The following search:list query works perfectly when I try accessing it from within by browser (as a link), but in php, I get that error when I try the same. $apikey_YT = <my API key>; $ytrequrl = "https://www.googleapis.com/youtube/v3/search?". "part=snippet"