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.
- Log in to the server by SSH.
- Find the cache folder. It is often
/var/cache/eacceleratoror/tmp/eaccelerator. - Delete the files in it:
rm -rf /var/cache/eaccelerator/*
This removes only saved copies. Check the path carefully before you press Enter.
- Restart the web server:
systemctl restart httpd
On some systems the name is apache2.
Fix 2: Fix the include order
- Open the PHP file that uses the classes.
- Make sure the file that defines the parent class is included first, using
require_onceorinclude_once. - Save the file and reload the page.
Fix 3: Turn eAccelerator off
- Find your PHP settings file, often
php.ini, or ask support where it is. - Find the line
eaccelerator.enable = "1"and change it to"0". - 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.
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.