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

Fixing the eAccelerator "Can't Restore Parent Class" Error

This guide explains this PHP error and gives simple ways to make it go away.

Web Hosting2 min read10 steps

What does the error mean?

PHP is the language that runs many websites. eAccelerator is an old add-on that makes PHP faster. It saves compiled copies of your scripts in a cache. A cache is a store of saved copies kept for speed. The error looks like this:

Fatal error: [eAccelerator] Can't restore parent class "ClassName" of class "OtherClass"

It means eAccelerator loaded a saved script, but it could not find the parent class that script needs. A class is a block of code, and a parent class is the one another class builds on. The problem is often a stale or damaged cache, or a change in load order.

Note that eAccelerator is old software. Newer servers use OPcache, which works in a similar way.

Fix 1: Clear the cache

You need root access for this. Root is the admin user with full control of a server. VPS and dedicated server customers have it.

  1. Log in to the server by SSH.
  2. Find the cache folder. It is often /var/cache/eaccelerator or /tmp/eaccelerator.
  3. Delete the files in it:
rm -rf /var/cache/eaccelerator/*

This removes only saved copies. Check the path carefully before you press Enter.

  1. Restart the web server:
systemctl restart httpd

On some systems the name is apache2.

Fix 2: Fix the include order

  1. Open the PHP file that uses the classes.
  2. Make sure the file that defines the parent class is included first, using require_once or include_once.
  3. Save the file and reload the page.

Fix 3: Turn eAccelerator off

  1. Find your PHP settings file, often php.ini, or ask support where it is.
  2. Find the line eaccelerator.enable = "1" and change it to "0".
  3. Save and restart the web server.

Fix 4: Use OPcache

If your plan allows it, pick a newer PHP version in your control panel. These use OPcache instead.

Tip: On shared hosting you cannot edit server settings. Open a support ticket and give the full error text.

Quick recap

  • The error comes from a stale eAccelerator cache.
  • Clear the cache and restart the web server.
  • Include parent classes first in your code.
  • You can turn eAccelerator off or use OPcache.
  • Ask support if you are on shared hosting.