Not able to fix the installation error, please find the PHP and OS version
php -v
PHP Warning: Module "pgsql" is already loaded in Unknown on line 0
PHP 8.1.16 (cli) (built: Feb 14 2023 18:59:41) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.16, Copyright (c) Zend Technologies
with Zend OPcache v8.1.16, Copyright (c), by Zend Technologies
-------------------
uname -a
Linux ip-10-80-0-4.eu-west-1.compute.internal 6.1.25-37.47.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Apr 24 23:20:16 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux