Home >Backend Development >PHP Tutorial > 大神求教,很简单的东西不好用啦,md5_file对2g的文件没用,该如何解决

大神求教,很简单的东西不好用啦,md5_file对2g的文件没用,该如何解决

WBOY
WBOYOriginal
2016-06-13 13:38:31699browse

大神求教,很简单的东西不好用啦,md5_file对2g的文件没用
$md5file = md5_file("1.zip");  
echo $md5file;
?>


代码非常简单,如上,获取md5值,如果1.zip比较几百兆或者更小,可以读出md5值,如果该文件比较大,我测试的一个是2g多,则获取不到值,页面等待了一会儿,显示
Fatal error: Maximum execution time of 30 seconds exceeded in F:\file\getMD5.php on line 2


求教

------解决方案--------------------
MD5是要抽取数据的,2G自然是太大,会超时。
------解决方案--------------------
set_time_limit(0);
$md5file = md5_file("1.zip");
echo $md5file;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn