Title: PHP issue when deactivating page cache
Last modified: March 29, 2021

---

# PHP issue when deactivating page cache

 *  Resolved [bigwheelwebdesign](https://wordpress.org/support/users/bigwheelwebdesign/)
 * (@bigwheelwebdesign)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-issue-when-deactivating-page-cache/)
 * Hi, my issue is that deactivating page cache causes php not to be executed but
   to show on the page. This means that we see ‘echo adrotate_group(8);’ where our
   ads should be.
 * It’s fine with page caching enabled but we need to use our hosting provider’s
   own caching plugin for that due to their settings, otherwise the cache doesn’t
   automatically clear when new posts are published, so the new posts don’t show
   up on the website.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-issue-when-deactivating-page-cache%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-issue-when-deactivating-page-cache/#post-14251479)
 * Hello [@bigwheelwebdesign](https://wordpress.org/support/users/bigwheelwebdesign/)
 * I am sorry about the issue you are experiencing and I am happy to assist you 
   with this.
    Have you by any chance wrapped the PHP code with <mfunc>, meaning
   used Page Fragment Caching for the specific PHP code? Which Page Cache method
   you are using? Thanks!
 *  Thread Starter [bigwheelwebdesign](https://wordpress.org/support/users/bigwheelwebdesign/)
 * (@bigwheelwebdesign)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-issue-when-deactivating-page-cache/#post-14251657)
 * Hi Marko,
 * The PHP is the output from the AdRotate plugin which we use to display advertisements.
   I haven’t wrapped it with any other code. The page cache method I’m referring
   to is the one in W3 Total Cache – when I disable it in W3TC the problem occurs.
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-issue-when-deactivating-page-cache/#post-14252912)
 * Hello [@bigwheelwebdesign](https://wordpress.org/support/users/bigwheelwebdesign/)
 * Thank you for the information. Well, this is a very strange issue.
    I am asking
   about the caching method in Performance>General settings>Page Cache. Is it set
   to Disk: Enhanced or Disk: Basic? Have you tried to delete the wp-content/cache/
   folder manually after the plugin is disabled and empty your browser cache? Thanks!
 *  Thread Starter [bigwheelwebdesign](https://wordpress.org/support/users/bigwheelwebdesign/)
 * (@bigwheelwebdesign)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-issue-when-deactivating-page-cache/#post-14254173)
 * Hi Marko,
 * It is really strange isn’t it? I could hardly believe that this issue could be
   caused by that, but I’ve recreated the issue several times – I can really turn
   the issue on and off by turning page cache on and off.
 * Sorry, I misunderstood the question – the page cache method is Disk Enhanced.
 * I haven’t tried manually deleting that folder. I will give that a try later but
   I’ll wait until about midnight tonight (London time) when our traffic isn’t usually
   as high, to avoid disrupting our site users if I make a mistake.
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-issue-when-deactivating-page-cache/#post-14254409)
 * Hello [@bigwheelwebdesign](https://wordpress.org/support/users/bigwheelwebdesign/)
 * Thank you for the info.
    It seems like the caching is actually only covering 
   the real issue. So once the cache is disabled the issue appears and since the
   page is cached the issue is not there. Have you tried purging the page cache?
   Thanks!
 *  Thread Starter [bigwheelwebdesign](https://wordpress.org/support/users/bigwheelwebdesign/)
 * (@bigwheelwebdesign)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-issue-when-deactivating-page-cache/#post-14254797)
 * Yes I purged the page cache before disabling it, but still the issue occurs. 
   It seems impossible doesn’t it? I’m really confused.
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-issue-when-deactivating-page-cache/#post-14255224)
 * Hello [@bigwheelwebdesign](https://wordpress.org/support/users/bigwheelwebdesign/)
 * Thank you for the information.
    Yes its very strange. Since the issue occurs 
   when the W3 Total Cache is disabled, I believe that the issue is not related 
   to our plugin. Simply because when the plugin is disabled, it does not have any
   effect on the page. Thanks
 *  Thread Starter [bigwheelwebdesign](https://wordpress.org/support/users/bigwheelwebdesign/)
 * (@bigwheelwebdesign)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-issue-when-deactivating-page-cache/#post-14255375)
 * Well it’s when the plugin or just the page cache section of the plugin is disabled
   that the error occurs. I see your point though.
 * I’ll try to get some support from the developers who made the ad rotation plugin
   we use. Maybe they can help.
 *  Thread Starter [bigwheelwebdesign](https://wordpress.org/support/users/bigwheelwebdesign/)
 * (@bigwheelwebdesign)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/php-issue-when-deactivating-page-cache/#post-14265636)
 * If anyone else is having this same issue with AdRotate when disabling the W3TC
   page cache – it’s a setting in AdRotate > Settings > Miscellaneous.
 * Disabling W3TC support here resolved the issue for me.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘PHP issue when deactivating page cache’ is closed to new replies.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [bigwheelwebdesign](https://wordpress.org/support/users/bigwheelwebdesign/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/php-issue-when-deactivating-page-cache/#post-14265636)
 * Status: resolved