Home  >  Article  >  Backend Development  >  PHP program causes hard disk space usage to skyrocket

PHP program causes hard disk space usage to skyrocket

黄舟
黄舟Original
2016-12-21 10:05:211093browse

This program instantly caused the CPU and memory of my computer to skyrocket. When I saw the hard disk space used, it also increased. Now I am at a loss. I can’t find the hard disk space being used? I can't restore the previous hard disk space size. I am a beginner in PHP. I hope you can give me some advice? Help is needed! ! !






$filename="/home/wanbo/test/file/test.txt";
if(file_exists($filename))echo "the file is there.";
else echo "there isn't such a file";
$myfile=fopen($filename,"a+");
fwrite($myfile,"hello,world");
while(!feof($myfile))
{
  $mychar=fgetc( $myfile);
echo $mychar;
}
fclose($myfile);
?>


The above is what the php program causes the hard disk usage space to increase , for more related content, please pay attention to the PHP Chinese website (www.php.cn)!


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