@diggy - Remi's php repo does provide it, but ensure you use 8.1 as the older 8.0 has an unpatched critical vuln.
However, despite osticket listing php-imap as "missing" in its information page, it appears to send and receive emails just fine for me, so it may not be needed. (I'm fetching from o365 though, ymmv)
@ntozier - For info, RHEL, Rocky and Alma are all identical (bar some commercial stuff in the first) and yep, they're rpm based, but since v.8 there are module streams which complicate things. Compiling php isn't really a thing as the point of EL is that it's all nicely packaged, but there's an excellent third party repo for PHP run by Remi which provides a lot of extra php packages.