You must be knowing thinkphp stores its run time stuff in the Runtime directory. The directory includes four sub-folders: Runtime/Cache, Runtime/Data, Runtime/Logs, and Runtime/Temp. If you do not know where thinkphp stores its data cache file, you will have trouble in debugging cache related problems. For example, if you are deploying a memcache system, what you do is to change the settings in cache.php and add a line ‘DATA_CACHE_TYPE’ => ‘Memcache’, then you expect to see the default file caching is replaced by your memcache, and it would be no more cache files under Runtime. If you take for granted that Runtime/Cache is used to save the cache files, you would be confused because the files in that directory still exist. The directory Runtime/Data is also not the data cache folder. In fact, Runtime/Temp is the folder thinkphp stores data cache files(if you use the file cache mechanism, of course). So when memcache is enabled, you won’t see files generated in Runtime/Temp any longer. However, that does not necessarily mean your memcache is configured properly. A not working memcache does not make your website display any error message in most cases(but the webpage loading speed is degraded). The exception is you does not install the php memcache extension when thinkphp will report the error “memcache not supported by system”. The correct way to check if cache system is working in thinkphp is calling its S function to see if it can set and get a variable successfully.
If you like my content, please consider buying me a coffee. Buy me a coffee Thank you for your support!