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!