php unlink cannot be deleted because fclose is not executed. The solution is: first create a PHP sample file; then open the file through fopen; then close the file through "fclose($fp);"; and finally delete it through unlink Just file.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
php encountered the problem that unlink cannot delete files today
//打开文件 $fp = fopen(文件名路径,'r'); ...... //注意关闭文件 fclose( $fp ); //再删除文件 unlink( 文件名路径 );
I forgot about fclose, so I never deleted the files, dizzy...
[Recommended learning: "PHP Video Tutorial"]
The above is the detailed content of What should I do if php unlink cannot be deleted?. For more information, please follow other related articles on the PHP Chinese website!