web-development-server

file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known

故事扮演 提交于 2019-11-26 14:43:15
I'm trying to download an image from a server using a PHP script on my website on xampp server. The image is being downloaded using the function file_get_contents. The php code for downloading on the server is: if(isset($_GET['path']) && isset($_GET['username'])) { echo "path:".$_GET['path']; $temp = explode(".", $_GET['path']); $extension = end($temp); $fname="images/".$_GET['title']; $filenameIn = $_GET['path']; $filenameOut = "" . $fname; $contentOrFalseOnFailure = file_get_contents($filenameIn); $byteCountOrFalseOnFailure = file_put_contents($filenameOut,$contentOrFalseOnFailure); } But I

file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known

一曲冷凌霜 提交于 2019-11-26 03:44:37
问题 I\'m trying to download an image from a server using a PHP script on my website on xampp server. The image is being downloaded using the function file_get_contents. The php code for downloading on the server is: if(isset($_GET[\'path\']) && isset($_GET[\'username\'])) { echo \"path:\".$_GET[\'path\']; $temp = explode(\".\", $_GET[\'path\']); $extension = end($temp); $fname=\"images/\".$_GET[\'title\']; $filenameIn = $_GET[\'path\']; $filenameOut = \"\" . $fname; $contentOrFalseOnFailure =