When I log in Elastic Beanstalk, I see that my platform is deprecated:

I guess it is because of the 7.2 PHP version that is now unsupported.
But when I click on change I don't see any higher version. In addition I can't find where in ElasticBeanstalk I can change the PHP version of my app.

The support for 64bit Amazon Linux 2018.03 v2.9.17 running PHP 7.2 finished on May 2, 2021. The only current versions of EB for PHP are based on Amazon Linux 2 (AL2).
Since AL1 is largely different then AL1 (what you have now), the only way to upgrade is to perform migration from AL1 to AL2 as explained in:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With