0

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?

6
  • Might be a network problem... Commented Dec 12, 2013 at 19:29
  • are you running this code through the cli, or a web server? Commented Dec 12, 2013 at 19:30
  • @ebadedude I'm running this on my local machine. It does make a remote connection to a MySQL database though. Commented Dec 12, 2013 at 19:34
  • @Shawn This is being run through Apache and my web browser. Commented Dec 12, 2013 at 19:34
  • Do you have xdebug installed, if true, then profile your code, this should give you a good hint about what is hapening at your case. Commented Dec 12, 2013 at 19:38

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

No NFS connection - this is running on my hard drive on my Mac. Just using my standard, local development machine.
@JackW-H What extensions do you have installed? Any opcode caching? How are you running PHP? FastCGI?
I literally just installed MAMP today, on a new machine. The only extensions installed would be one of those listed here: mamp.info/en/mamp/index.html
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.