I have a problem when we run an update for our web application.
After the update, the script is completed and access to the web application through the browser is opened, we get the file of not found errors on require_once (), because we moved some files, and PHP still has the old directory structure, cached.
If the default expiration of realpath_cache_ttl is 120 seconds, then everything will resolve, but this is unacceptable for obvious reasons.
So I tried using clearstatcache with limited success. I created a separate file (clearstatcache.php) that calls this function only (single-line file), and put it in our installation script via curl:
<?php clearstatcache(true);
This does not work, however, if I call this file through the browser, it immediately starts working.
I am running PHP version 5.3
I began to study the differences in request headers between my browser and curl, and the only thing I can see is that it matters in the cookie of the PHPSESSID file.
So my question is: is the current PHPSESSID problem (I donβt think it should). Am I something wrong with my curl script? I use
curl -L http:
EDIT:. After further research, I decided that this probably relates to several Apache processes. clearstatcache will only clear the cache of the current apache process - when the browser makes a request, another request processes another apache process, and this process still has the old cache.