Centos 8 – Uncaught Error: Call to undefined function pg_connect() when using PHP to PostgreSQL connection

If you get an uncaught error: Call to undefined function pg_connect() when using PHP to PostgreSQL connection, it’s pretty easy to fix it on Centos 8.

Just install the PostgreSQL database module for PHP called: php-pgsql.x86_64

To do so run:

sudo dnf install php-pgsql.x86_64