PHPOffice: PHP Fatal error: Interface 'Psr\SimpleCache\CacheInterface' not found

1.6k Views Asked by At

I have custom WordPress plugin where I giving option for admins to download export of survey. The plugin using package phpoffice I have test hosting with PHP 7.3 where export goes well and the production hosting is on PHP 7.3.3 (before it was PHP 7.4) where the exactly same problem does not work.

I'm expecting to resolve this error and make the option for download exports working.. I've tried searching for google but I didn't find solution exactly for my problem. I tried this stuffs:

  1. Upgrade memory_limit from 256MB to 512MB
  2. Tried to downgrade production hosting PHP version from 7.4 to 7.3.3

When production hosting PHP version was 7.4 it gived this error in PHP error log:

[22-Dec-2022 08:45:24 UTC] PHP Fatal error:  Uncaught Error: Interface 'Psr\SimpleCache\CacheInterface' not found in /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php:14
Stack trace:
#0 /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/composer/ClassLoader.php(571): include()
#1 /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/www/doc/www.di...')
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass('PhpOffice\\PhpSp...')
#3 /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php(164): spl_autoload_call('PhpOffice\\PhpSp...')
#4 /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/CellsFactory.php(19): PhpOffice\PhpSpreadsheet\Settings::getCache()
#5 /www/doc/www.digitalniagora.cz/www/wp-content/ in /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php on line 14

After I downgraded the PHP version to 7.3.3 (because I haven't option to downgrade to PHP 7.3) I getting just this error:

[27-Dec-2022 15:43:23 UTC] PHP Fatal error:  Interface 'Psr\SimpleCache\CacheInterface' not found in /www/doc/www.digitalniagora.cz/www/wp-content/plugins/agora_survey/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php on line 14

EDIT 29.12.2022: I tried update PHP version on test hosting to the same version as production hosting is but on test version it working well and production version code does not work.

But the code is exactly same as on test hosting where everything works well and also the code is exactly same after downgrade PHP version.. Can anybody give me some hints to find the solution?

0

There are 0 best solutions below