Problems with Yii caching

Hello,

I seem to be having trouble with the Yii cache or something. I am trying to edit the Hangman game that comes with the Yii distribution and none of my changes to the views appear on the browser. If I rename the directory, the changes appear. But then when I make new changes, the new changes don't appear. It's very annoying. It seems that Yii is caching the views. What can I do?

Daniel.

Could it be that you have apc.stat=0?

More information on this:

I have APC off (apc.enabled=0) and I just commented 'apc.stat' as per mikl's suggestion, but it didn't help.

This is what I’m trying to change: I want to add some pictures to the hangman game. So I made a bunch of PNG images and I edited the view guess.php by adding the following line:



<img style="position: absolute; top: 50px; right: 100px;"


 src="/yii-1.0.1/demos/hangman/assets/img/<?=$this->level?>_<?=$this->misses?>.png"/>


But Yii seems to be ignoring the image tag. If you go to “view source”, the image tag is not there anymore. Unless I copy the yii-1.0.1 directory to something else, at which point the first tag becomes visible but then it doesn’t update when you select a letter.

Strangely, I just made another copy of the directory (this is the 8th copy) and now the images work! But if I try again with other copies, it still doesn't work. So it definitely looks like some type of cache problem. It's not apc.stat because if I uncomment that line, the 8th copy continues to work. And remember I have set apc.enabled=0.

This is very strange.

Hmm, i still suspect APC. Can you make sure that it's off, by putting a

phpinfo();exit;

to the beginning of your index.php and verifying it's output about APC?

Yii doesn't cache those view files…

You are right. APC is enabled. How do I turn it off? I set apc.enabled=0 and apc.enabled_cli=0 in etc/php5/conf.d/apc.ini and I restarted Apache and phpinfo() still see APC enabled. I can even run apc.php and it says "uptime 1 minute" (I restarted Apache 1 minute ago).

Can't you just comment out the extension line for APC in php.ini?

I moved apc.ini to _apc.ini and that fixed the problem.

Thanks.

How do I submit a patch for the hangman demo? I uploaded a new version to my website:

http://daniel.carrer…-2009-01-23.tgz

This is just the demos/hangman directory. The only changes are:

  • I edited the view files to include a hangman image.
  • I added hangman images in demos/hangman/assets/img

License: None. This is public domain.