Jump to content

How can I make PHP stop caching my files?


DWilliams

Recommended Posts

At least, I assume that's what it's doing.

 

I have a CLI script that reads in a bunch of PHP files every time it starts and stores their contents in a big array to be called with eval() later.

 

I have two bits of evidence to suggest PHP caches these files in-between executions:

1. If my script hasn't been run for several hours, it takes a fair amount of time to start up. This is to be expected since it has quite a bit of work to do to load in all these files. If I run my script, exit it completely, and run it again within a short period of time, it starts up and loads all files instantly.

 

2. If the PHP script in one of these files contains an error and is read in, changing it does not correct the problem. I've commented the problem line out, fixed it, and even completely removed it from the file but when my main script is loaded again it will still generate an error based on what was previously in the file.

 

So, how can I force PHP to always read directly from disk and not use whatever caching mechanism it's using? I'd prefer some way to do it within my script instead of a config file if possible.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.