I found a very weird bug...
I changed a PHP file on my VPS and added a debug line that echoes a string. After it, I changed my server's timezone and also the date (both were wrong). Now when I modify that file, nothing is changed on the live site.
I've double-checked if I wasn't writing on the wrong file/dir, and have done some testing to be sure I'm on the right file:
- Added another file on the same folder and tried accessing it from the live site [worked, ok]
- Modified that file and accessed again [worked, ok]
- Modified other files that already existed on the same folder [didn't work, the changes didn't take any effect]
- Added
die("test");
at the top of my index.php file so my site would stop working [didn't work, the entire site worked normally without any "test" die o.O ] - Renamed index.php to ofaiwjefiow.php (of course this filename isn't on my .htaccess's DirectoryIndex) [didn't work, the entire site continued working normally as if there was an index.php file - i checked if there are other possible directory indexes such as index.html but there weren't].
- With the original index.php renamed, added another index.php file containing only one string "test" and nothing more [the old index.php file continued being executed - of course I didn't include it]
- Renamed this "test" index.php to index.html [it worked, so it looks like this issue is only with .php files]
- Checked if some native caching such as APC was enabled [it wasn't - also, my application is coded from scratch, too simple, uses standard PHP/no frameworks, and didn't need a caching system so I didn't code it nor used any framework or library that could create a cache - I didn't even use Composer]
- Tried
touch
ing the files [their last modified date is ok, showing the current time, however it also produced any change] - Browser cache clearing, tried also on other browsers where I didn't access this site before [same thing]
- Restarted Apache [same thing]
My bet is that some Unix caching that I am not aware of (nor installed it) is keeping the old files since they 'exist since the future' (because my system clock was wrongfully set to afterwards) and my recent changes happened 'before' (according to the system clock) those wrong ones. I just don't know how to find and disable/refresh it...
Server: Ubuntu, Apache, PHP 5