Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
内存泄漏?xampp无法运行PHP进程_Php_Xampp - Fatal编程技术网

内存泄漏?xampp无法运行PHP进程

内存泄漏?xampp无法运行PHP进程,php,xampp,Php,Xampp,我一夜之间在本地环境下开发了一个php+mysql+simpleDOM脚本(使用xampp),我的xampp似乎无法处理更多的file\u get\u contents()命令和其他与DOM相关的函数 总是给出错误,比如: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Not enough storage is available to process this command 很有趣,因为这是PHP,所以

我一夜之间在本地环境下开发了一个php+mysql+simpleDOM脚本(使用xampp),我的xampp似乎无法处理更多的file\u get\u contents()命令和其他与DOM相关的函数

总是给出错误,比如:

file_get_contents(): php_network_getaddresses: getaddrinfo failed: Not enough storage is available to process this command
很有趣,因为这是PHP,所以没有内存泄漏,对吗

我的php.ini内存限制已设置为512M。有什么我应该知道的吗

这个函数一开始似乎在工作,第三次运行后,它给了我这个错误。我需要做些什么来释放我的记忆

=================================== 回答评论:

以下是我正在使用的函数:

<?php
function get_country($domain) {
$ip = gethostbyname($domain);
$details =  json_decode(file_get_contents("http://ipinfo.io/{$ip}"));
return $details->country;
}

echo get_country("stackoverflow.com"); // -> "US"
echo get_country("bbc.co.uk"); // -> "GB"
?>

==================================


Windows7,64位谢谢

如果您提供的代码实际使用的是
file\u get\u contents
,这会有所帮助。您使用的是什么操作系统?顺便说一句,我已经尝试重新启动xampp服务了。运气不好,现在我开发受阻。@thattiguy请检查编辑。谢谢。@user1824371这不是php,getaddrinfo内部有问题: