We did setup Varnish correctly and working fine to cache the files.

However, when Magento try to purge cache on product saving or from cache management, we have the following error:

[2024-04-16T02:27:24.463621+00:00] main.CRITICAL: No cache server(s) could be purged Cache host: in error message: Deprecated Functionality: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /bitnami/magento/vendor/laminas/laminas-http/src/Client/Adapter/Socket.php on line 457 {"method":"POST","url":"https://domain.tld/index.php/admin/admin/cache/massRefresh/","invalidateInfo":{"servers":[{"Laminas\\Uri\\Uri":"//"}],"formattedTagsChunk":".*"}} []

curl is working fine to reach Varnish.

  • Looks like php8.1+ compatibility error... Be sure to update all Magento dependencies Apr 16 at 15:07
  • Yes, I did but I will check again again. The version used is the latest on the GitHub project.
    – nlegall
    Apr 16 at 15:35

2 Answers 2


You can add the null coalescing operator to this line of code:

$method = strtolower($method); Replace it with:

$method = strtolower($method ?? '');

For same you can create a Custom patch and apply it using git apply command


  • I did try but Magento doesn't want to use it. I will try to patch the file using composer to make the modification before Magento deploy or compile the code. Thanks you for the code!
    – nlegall
    Apr 18 at 1:19

The issue was a custom code forcing some value before Magento call the lib: plugin for Magento\PageCache\Model\Cache\Server. Fixing this allow to fix the issue without editing the code on vendor side.

Thanks for the help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.