简体   繁体   中英

PHP seems to be caching my code

I'm currently testing a web application and kept noticing my changes weren't being updated after each save of the PHP file.

As far as I'm aware, I'm using no current PHP caching solution. I'm running PHP 5.5.3 with a fresh copy of CodeIgniter.

Here's what happened:

  • I noticed PHP didn't seem to be loading the latest code changes as I made them
  • After noticing the problem, I output <?php echo time();?> into all my view files
  • Now, the time updates on every page load - indicating PHP is processing each page's code
  • But still sometimes the page code updates don't take place until 3-5 page loads later
  • I've tried disabling and empty my browser cache multiple times

Am I right in thinking this is a PHP issue rather than a browser one, given the fact that the time() output is being updated?

PHP doesn't cache anything.

If time() is being updated, you know that there isn't a traditional cache issue.

It's possible you are dealing with filesystem caching if you are using something like NFS. That would explain the 3-5 second delay.

Well that was frustrating. Turns out that MAMP now installed and enables, by default, Zend OpCache - see Stop caching for PHP 5.5.3 in MAMP

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM