In Magento "version": "2.4.3" I am facing this error during executing bin/magento setup:static-content:deploy -f; Anybody had this issue ?

    Fatal error: Cannot use ::class with dynamic class name in /var/www/html/vendor/laminas/laminas-mail/src/Message.php on line 394
ERROR: 255

3 Answers 3


Be sure that your version of PHP 8.0+. PHP version in my CLI was 8.1, but my server hasn't changed the version to 8.1(was 7.4), it was just the CLI version due to my alias. That's why I didn't got any results after debugging. Community 2.4.5-p1

P.S. I faced the same issue in the Laminas\Http\Headers on line 162.


The laminas-mail module that you are using is probably just compatible with PHP 8, and you might be running a lower version (7.4, 7.3...)


I am also facing the same issue but its in Magento 2.4.4.

Which version are you using? Is it Open source or Adobe Cloud?

As my issue is coming in Adobe cloud 2.4.4 and I see that the error you are facing does not exists in 2.4.3 I just checked the 2.4.3 file

Let me know


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.