Friendsofcake/cakepdf gives me exception when trying to install it with composer in cakephp 4.4

I am trying to install plugin cakepdf in my site but gives me this exception:


How can I solve this issue?

Did you try the suggestions made in the last line, to figure out which version of cakephp is compatible with your PHP version?

Looks like you might also need to upgrade the acl plugin.

Yes, I put composer require friendsofcake/cakepdf:* but it doesn’t show me what version is compatible with php, is still showing me the same exception.
Do you know what version of cakepdf should I install in cakephp 4.4?

Looks like you’d want the 4.x branch.

Yes, and how can I install that branch? I put composer require friendsofcake/cakepdf:^4.x and is still giving me the exception

Well the acl plugin you are using does not support PHP 8, so thats one problem.

We as the core team are not supporting the ACL plugin anymore since the new authentication and authorization plugins are a better abstraction on how to do these kind of checks.

So either stay on PHP 7.4 or replace the ACL plugin.

Thats at least how you can solve Problem 1 mentioned in the error above.


To fix Problem 2 you can try to do a simple composer update -W or do a

composer require friendsofcake/cakepdf:^4.x -W

The -W is important to tell composer that already existing dependencies can be up/downgraded as well which is not the default.

Sorry, i was wrong. I misread the composer.json constraint of >=7.2 with ^7.2

As can be seen in PHP Version Stats - cakephp/acl - Packagist the ACL plugin can indeed be installed with PHP 8.0+

But what I can see is that you are on a bit of an older version of the plugin. 0.8 added PHP 8.1 support and 0.9 fixed some deprecations with PHP 8.2

Try to upgrade to the latest 0.10 via adjusting your composer.json AND doing a composer update -W

Thats at least the easier way of getting your app running than refactoring to the new auth plugins.