Parse error after deactivating W3 Total Cache

Blog, Tutorials Dec 04, 2011 7 Comments

WordPress White Screen Of Death (WSOD) caused by W3 Total Cache

Last night I migrated my websites to a VPS server on pair.com  and one of my websites ended up showing the dreaded WordPress White Screen Of Death (WSOD).

I was using the latest version of W3 Total Cache (0.9.2.4) and CloudFlare on the website, and was not sure why I got the WSOD. I was able to view html and php files on the same website fine, but WordPress files just showed the white screen of death on the front end of the website.

Both the domain name which goes through the CloudFlare system as well as my dedicated IP address for the website which by-passes the CloudFlare system, showed both the WSOD, so I could rule out CloudFlare.

The Admin backend was still functional, so I went and cleared the W3TC cache, but nothing changed, still a white homepage. I then started by disabling plugins in WordPress to see what could cause the WSOD.

As soon as I deactivated W3 Total Cache I got a “Parse error: syntax error, unexpected T_STRING in /……./wp-config.php on line 17“.

I looked in the wp-config.php and on line 17 was the define(‘DB_NAME’, ”); code. everything looked fine, but it still was giving me the error.

Wordpress Parse Error W3 Total CacheAfter examining an older copy of the wp-config.php, I could see that W3 Total Cache removed it’s own code from the wp-config.sys and pushed the default comment field right into the <?php syntax.

By moving the start of the comment to a new line solved the parse error.

<?php/**
to
<?php
/**

After fixing the parse error and having CloudFlare in Development Mode as well trying my direct IP address to the website, I was able to see that the site loaded again and no issue with WSOD.

I am not sure why W3TC gave me the WSOD, but after uninstalling it and re-installing it and then removing some of the options that I had on my previous settings, it now seems to work.  I am still investigating which setting that caused WordPress to display the WSOD.

I also would like to mention that Pair.com support was also very helpful, checking my settings and helping me re-syncing the the new site with my old content when experiencing the issues.

7 Responses to “Parse error after deactivating W3 Total Cache”

  1. Kyle Newman says:

    Thanks for this post! I just had exactly the same problem and you’ve helped me solve it with minimum grief. So kudos to you! Thank you, thank you, thank you!

    Kyle

  2. Darryl says:

    Thank you. I too just had this issue after disabling W3TC cache. Thank you for the fix! Saved me hours of frustration and having to contact my host’s customer support.

  3. Chandler says:

    Thanks for sharing your fix, MK. Back in business!

  4. Peter says:

    Wow, thank you, than you, thank you!! Solved my problem completely!

  5. Rachel says:

    Thank you very much to you. You saved my life! Really a big help, that was exactly my problem :)

  6. Mike says:

    You just saved me as I experienced the exact problem. Thank you!

  7. mohan says:

    I am also facing the same problem which you faced.My site is showing same error.I will try this fix.Thanks for the post.

  8. max says:

    I love you !

  9. Tudor Catalin gheorghe says:

    Ohh man thank you!i DID NOT KNOW WHAT TO DO WITH IT I DID NOT UNDERSTAND WHY IS GIVING ME THAT ERROR, THIS INFO SOLVED MY PROBLEM, GOOD ARTICLE THANKS!

  10. Deborah says:

    Hi
    Many thanks for this post. I had exactly the same problem after I disabled the W3 Cache. After seeing your solution I went into change the wp-config file. The site has now reloaded fine. However, I initially disabled the W3 Cache plugin to resolve an issue which I still haven’t yet sorted. If you look at my website http://www.lethalmarketing.co.uk within the footer are links to
    online marketing (I didn’t create this link within the footer… I just put it under the services tab)
    social media (again I didn’t create this link within the footer … I just put it under the services tab)
    web design (again I created this link under the services tab… but noticed that despite going to my web-design page which has been newly created its linking to
    http://www.lethalmarketing.co.uk/web-design-2 ??? very strange

    When i did a bit of digging round for this link this came up
    public_html/wp-content/w3tc/pgcache/services/web-design-2

    What is all this about. My website seems to be creating / duplicating itself within the footer.
    Can anyone help!! Also is it wise to re activate the W3 Cache pluging again??

  11. Nomad says:

    Thanks a lot.

    You’ve literally saved me a lot of time :)

Leave a Reply