For AWS Elastic Beanstalk using PHP 8.3 and Amazon Linux 2023 I used this and it worked:
#!/usr/bin/env bash
sudo yum install php-pear libzip libzip-devel
sudo dnf install -y php8.3-zip