Why does caching in CakePHP 2.2.4 cause a blank white page after caching a view?

I am updating CakePHP 1.3 to version 2.2.4 and have followed the steps described in CakePHP Book 2.0 to enable caching. Viewing caching works fine in app 1.3, but when I turn it on in app 2.2.4, each view will be displayed initially. However, as soon as the view is cached, any subsequent attempt to load this view results in a blank page without source code and error messages.

Here is what I tried to do so far:

  • Experimenting with a change in the debugging level from 0 to 1 and up to 2.
  • Double checked my boot file to make sure CacheDispatcher is loaded.
  • Double checked my AppController for the public $ helpers = array ('Cache');
  • Double checked my AppController for public $ cacheAction = true;
  • chmod folders, subfolders and tmp files on 777.
  • I checked the error and error logs for errors and did not find anything.
  • Apache error and access logs are also missing errors.

If I remove the cached view from tmp / cache / views, then reload the page on which it is displayed. But then another reload results in a blank page because the view was cached. Any idea what is going on here? It worked in app 1.3 ...

+4
source share
2 answers

In my application controller, I changed: public $ cacheAction = true; to public $ cacheAction = "1 hour"; and now views are displayed from the cache instead of a blank page. I am going to call it fixed.

+5
source

Completely blank page without errors, messages ... etc. it is almost always a space or an extra character after the end of the PHP tag in the PHP file. Test your controllers, models, behavior, etc. (It is good practice to simply not close your PHP tags at all when the file is only for PHP. This will cause the blank screen object to not happen).

0
source

All Articles