Title: mfunc not working &#8211; PgCache.php not running wp-config.php?
Last modified: August 22, 2016

---

# mfunc not working – PgCache.php not running wp-config.php?

 *  [mimetic](https://wordpress.org/support/users/mimetic/)
 * (@mimetic)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/mfunc-not-working-pgcachephp-not-running-wp-configphp/)
 * I’m trying to get mfunc to work. So, I have set a value for “W3TC_DYNAMIC_SECURITY”
   in wp-config.php.
    However, I’ve discovered that the PgCache.php does not get
   a value for “W3TC_DYNAMIC_SECURITY”, so it thinks all cached pages are non-dynamic,
   and __parse_dynamic() always returns without trying to replace dynamic code.
 * It appears that wp-config.php isn’t being loaded each time PgCache is called —
   my testing output log shows this — so that’s why mfunc just won’t work!
 * If I add
 *     ```
       define('W3TC_DYNAMIC_SECURITY', 'mySecretCode');
       ```
   
 * inside of the _parse_dynamic() function in PgCache.php, my ‘mfunc’ code works.
 * [https://wordpress.org/plugins/w3-total-cache/](https://wordpress.org/plugins/w3-total-cache/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [mimetic](https://wordpress.org/support/users/mimetic/)
 * (@mimetic)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/mfunc-not-working-pgcachephp-not-running-wp-configphp/#post-5546800)
 * This is a real big problem…with the above fix, W3TC starts parsing the code between
   the mfunc tags. However, now I see the second issue — you use an “eval()” and
   your code will only work with PHP code in the mfunc, not HTML code.
 * AdRotate inserts HTML text, not PHP. That means AdRotate won’t work with the 
   caching.
 * Argh!!!! What to do?

Viewing 1 replies (of 1 total)

The topic ‘mfunc not working – PgCache.php not running wp-config.php?’ 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/)

 * 1 reply
 * 1 participant
 * Last reply from: [mimetic](https://wordpress.org/support/users/mimetic/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/mfunc-not-working-pgcachephp-not-running-wp-configphp/#post-5546800)
 * Status: not resolved