Magento

Disable Compiler in Magento to Fix Blank Frontend and Admin Issue

Recently a client experienced an issue with their Magento site displaying a blank white page on the front end and for the admin page when accessed through the browser. With the site completely inaccessible it is impossible to identify any issue within the admin / config.

There had been some recent extension installations and tweaks made to settings within Magento, but after testing at the time there were no issues and no further changes made after this point which could have caused the site to error and be inaccessible.

After a little investigating I found the issue, basically someone had enabled the compiler within Magento’s admin which had caused a conflict, possibly with recent extension installations.

To fix this blank page issue in Magento, caused by Magento’s compiler, we can make an edit to the root folders index.php file by commenting out a few lines of code which will disable compiler for us.

Disable Magento Compiler

With Magento’s frontend and admin inaccessible to us, we cannot access the admin menu to disbale compiler within the System > Tools menu. Instead you need to FTP to the root directory of your Magento installation and open your Magento sites index.php file in an editor of your choice.

Once index.php is open in your editor, find the 4 lines of code below.


$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;
}

After locating the code above, simply comment it out, then re upload your index.php file.


#$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
#if (file_exists($compilerConfig)) {
    #include $compilerConfig;
#}

If you still see a blank page after taking the above action, you may need to clear your browsers cache, along with manually deleting Magento’s cache in your installations var/cache and var/sessions directories.

Cause for Magento Compiler Issue

There can be a few causes for the described issue with compiler, such as new modules not working with compiler or enabling compiler without it being run prior.

Once your store is back up and running you can remove the comments and test running and enabling compiler within your Magento stores admin.


12 Responses

  1. Oana
    May 26, 2015

    Thank you! You’ve saved me today! 😀

    Reply
    • Porter
      May 28, 2015

      No worries, glad my experiences have helped someone encountering the same issue.

      Reply
  2. jean
    June 3, 2015

    thank you,the problem has been solved

    Reply
  3. Johan
    June 25, 2015

    Thank you so much Porter!

    You have saved me hours-upon-hours of work!!!

    Regards,
    Johan

    Reply
    • Porter
      October 23, 2015

      No worries, glad it was helpful.

      Reply
  4. Ric
    July 24, 2015

    Works for me, thank’s.

    Reply
  5. Anushka
    April 16, 2016

    Hello,

    It has not solved my issue, it is still blank. Can someone help me?

    Backend is working but frontend not.

    Reply
    • Porter
      April 28, 2016

      Hi Anushka, what exactly is happening? What did you do before the error presented itself? Also, double check that the maintenance flag file is not present in the root directory.

      Reply
  6. Mubarish
    June 13, 2016

    I got an error again

    Reply
    • Porter
      June 15, 2016

      It would seem that your error is related to the maintenance flag file being present in your root directory of the Magento install. Delete the maintenance.flag file and try to access the site again.

      Reply
  7. sushil
    June 18, 2016

    It worked thank you.

    Reply
  8. Mike
    August 9, 2016

    Thank you!! 🙂

    Reply

Leave a Reply