Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

What Is Magento Compilation and How to Turn It Off

This guide explains the Magento compiler in plain words. It also shows you how to switch it off when it causes trouble.

CMS and Apps2 min read12 steps
Tip: This guide is for Magento 1.x, which is old software. Magento 2 has its own, different compile tool. The ideas are similar.

What is Magento compilation?

Magento is a free tool for building online shops. It is made of thousands of small code files. When a page loads, Magento hunts for the right files. That takes time.

Compilation gathers many of those files into one place. It is like putting all your school books into one bag. Magento then finds them faster. This can make the shop load a bit quicker.

Why turn it off?

Compilation can cause problems. After you add an extension, change code or upgrade Magento, the compiled copy may be out of date. You can then see blank pages or errors. Turning it off lets Magento use the original files again.

It can also stop you from installing new extensions. Many errors during install come from the compiler being on.

Before you start

Take a backup of your files and database. You can pause during quiet hours so that shoppers are not affected.

Steps: turn it off in the admin panel

  1. Log in to the Magento admin panel.
  2. Click System, then Tools, then Compilation.
  3. Look at Compiler Status. It shows Enabled or Disabled.
  4. Click Disable.
  5. Check that the status changes to Disabled.

Steps: turn it off by hand

Use this when you cannot open the admin panel.

  1. Open File Manager in your hosting control panel.
  2. Go to the folder where Magento is installed.
  3. Open the includes folder.
  4. Find the file config.php.
  5. Right-click it and choose Edit.
  6. Find the line that begins with define('COMPILER_INCLUDE_PATH'. Put // at the very start of that line. Do the same for the next line, define('COMPILER_COLLECT_PATH'.
  7. Click Save Changes.

The two slashes turn the line into a comment, so Magento ignores it. To switch compile back on, remove the slashes.

After turning it off

Go to System, Cache Management. Click Flush Magento Cache. Then open your shop and check that it loads.

Quick recap

  • Compilation gathers Magento files together to speed up the shop.
  • It can cause errors after changes or installs.
  • Disable it in System, Tools, Compilation.
  • Flush the cache afterwards.