This question is related with the following one: How to enable IMAP php extension on aws EC2 instance but they are completely different.
I use PHP 8.1 and Amazon Linux 2023, this version does not have "amazon-linux-extras", so I can´t install it.
In the following link we can see the list of packages, if we filter by "php8.1" we will see that "php8.1-imap" does not exist: All the packages AL2023
I think I need to run the following command: sudo yum install libc-client-devel uw-imap-static openssl-devel -y
but only "openssl-devel" is part of the list of packages of AL2023, I have no idea how to install it.