php method to delete expired files: [public function download_project($array)$tmp = 'tmp_down';$savepath1 = '../public'.$tmp;$path1 = dir(...] .
The operating environment of this article: windows10 system, php 7, thinkpad t480 computer.
You must have encountered such a situation, server The disk space occupied is 100%. The reason may be that the temporary folder for project package download is full.
So how should we solve this problem? In fact, it is very simple, just
Solution: Clear the expired files before each download so that they will not take up disk space.
Specific code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Recommended learning: php training
The above is the detailed content of How to delete expired files in php. For more information, please follow other related articles on the PHP Chinese website!