Home  >  Article  >  Backend Development  >  How to automatically delete php tmp

How to automatically delete php tmp

藏色散人
藏色散人Original
2021-05-10 09:56:531905browse

The solution to automatic deletion of php tmp: first enter the WIN2003 system; then use the system's scheduled task to call batch processing and clean up tmp regularly.

How to automatically delete php tmp

The operating environment of this article: windows server 2003 system, PHP7.1 version, DELL G3 computer

Specific questions:

How to set php to automatically delete temporary files starting with sess_ in the tmp folder?

The server is WIN2003 PHP MYSQL. When I restarted the server recently, MYSQL started very slowly. I checked that there are more than 300,000 temporary files starting with sess_ under c:\windows\temp. Can I set PHP to automatically delete these files?

After checking the folder permissions, there should be no problem.

Solution:

Use the system's scheduled task to call batch processing and clean it regularly.

Under normal circumstances, there should not be so many temporary files in the temp directory. They should be deleted or updated by the program itself.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to automatically delete php tmp. For more information, please follow other related articles on the PHP Chinese website!

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