Support

Admin Tools

#38422 0 Class "Akeeba\Component\AdminTools\Administrator\Provider\CacheCleaner" not found

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
4
PHP version
8
Admin Tools version
7.2.1

Latest post by nicholas on Sunday, 29 January 2023 07:53 CST

agrobiobrichet

Hi,

 

I tested on localhost, on server,

after installation, i got error. I tested with clean Joomla and the same issue. Pro and free version, the same error

An error has occurred.
0 Class "Akeeba\Component\AdminTools\Administrator\Provider\CacheCleaner" not found

nicholas
Akeeba Staff
Manager

Delete the file administrator/cache/autoload_psr4.php and reload the page. Joomla will create this file afresh with the information from all installed extensions and the error will go away in the vast majority of cases.

If this didn't work, check if the autoload_prs4.php file got generated. If it did and it contains the line

'Akeeba\\Component\\AdminTools\\Administrator\\' => [JPATH_ADMINISTRATOR . '/components/com_admintools/src'],

the the problem is with your server. Contact your host and ask them to check why PHP does not read the newly regenerated administrator/cache/autoload_psr4.php file correctly. In most cases it's a problem with OPcache and the value of the opcache.revalidate_freq PHP configuration setting.

If, however, the administrator/cache/autoload_psr4.php file was NOT regenerated (it's now missing) your cache folder may not have the right ownership or permissions. We can try to address that:

  • Change the permissions of the administrator/cache folder to 0777.
  • Delete the file administrator/cache/autoload_psr4.php.
  • Reload any page on your site.

If this worked you should really talk to your host about fixing the ownership and permissions of the administrator/cache folder so that it's writable by PHP. The 0777 permissions is a painkiller, not a cure.

If this still does not work:

  • Delete the folder plugins/system/admintools.
  • Delete the file administrator/cache/autoload_psr4.php.
  • Go into your site's administrator.
  • Make sure the Extension - Namespace Updater plugin is enabled. If not, enable it now; it's a required plugin.
  • Download and reinstall Admin Tools, twice in a row, without uninstalling it before or in between.

Why this happened to you

The administrator/cache/autoload_psr4.php file maps every installed extension's path (folder) to the PHP namespace the extension is using. If this file does not exist, or if it is out-of-date to the extensions installed on your site, some or all of the installed core and third party extensions will fail to load with a PHP error as Joomla will be unable to find their files. As you understand by now, this little file is the keystone of your Joomla! site. If it's missing or broken the whole site comes tumbling down in a pile of rubble!

Joomla normally updates the autoload_psr4.php file automatically when you install or update an extension. In some cases the file cannot be regenerated e.g. wrong file ownership or permissions of the file or its containing folder, making it impossible for Joomla to regenerated the file, or when the Extension - Namespace Updater plugin is disabled.

Joomla should detect that problem and refuse to install or update extensions. Instead, Joomla blithely proceeds like nothing's wrong. This predictably results in the extension failing to execute with a misleading PHP error message implying that the extension developer did something wrong.

The truth is that the root cause is either a server misconfiguration Joomla does not warn the user about, or Joomla letting the user do something catastrophic (disabling a required plugin) without warning or stopping the user. I think it's reasonable to say that Joomla not addressing two of the three failure modes of its keystone file is a Joomla bug. (If you're wondering, the third and final failure mode is that the file is intentionally sabotaged outside of Joomla, made so it no longer contains valid PHP code, a failure mode it's not reasonable to expect Joomla to detect or protect you from.)

As you can see in the links above, Joomla is aware of these issues for well over 2 years and has taken no action whatsoever, leaving you confused as to why the software you paid for "doesn't work" and us trying to explain what Joomla should have caught and told you about long before you felt the need to contact us, giving you slightly complicated instructions which have NOTHING to do with our own software and EVERYTHING to do with Joomla itself. Preposterous, isn't it?

 

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!