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

时间:2013-12-02 19:38:36

标签: php xampp

我一直在本地环境(使用xampp)过夜开发php + mysql + simpleDOM脚本,好吧,我的xampp似乎无法处理更多的file_get_contents()命令和其他与DOM相关的函数。

总是给出类似的错误:

file_get_contents(): php_network_getaddresses: getaddrinfo failed: Not enough storage is available to process this command

有趣,因为这是PHP,所以没有内存泄漏吗?

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

该功能似乎首先工作,然后在第3次运行后,它给了我这个错误。我需要做些什么来释放那段记忆?

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

这是我正在使用的功能:

<?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"
?>

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

Windows 7,64位谢谢!

0 个答案:

没有答案