PostgreSQL Connection Diagnostic Tool

Test 1: PDO PostgreSQL Extension

✓ PDO PostgreSQL extension is loaded

Test 2: Available PDO Drivers

Array
(
    [0] => mysql
    [1] => odbc
    [2] => pgsql
    [3] => sqlite
)
✓ PostgreSQL driver is available

Test 3: Connection Tests

Original Config

DSN: pgsql:host=localhost;port=5432;dbname=engrprimusapps_chats_group
Username: engrprimusapps_devotions_prayers
✓ Connection successful!
PostgreSQL Version: PostgreSQL 17.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5), 64-bit
Connected to database: engrprimusapps_chats_group

Alternative Config 1 (no port)

DSN: pgsql:host=localhost;dbname=engrprimusapps_chats_group
Username: engrprimusapps_devotions_prayers
✓ Connection successful!
PostgreSQL Version: PostgreSQL 17.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5), 64-bit
Connected to database: engrprimusapps_chats_group

Alternative Config 2 (127.0.0.1)

DSN: pgsql:host=127.0.0.1;port=5432;dbname=engrprimusapps_chats_group
Username: engrprimusapps_devotions_prayers
✓ Connection successful!
PostgreSQL Version: PostgreSQL 17.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5), 64-bit
Connected to database: engrprimusapps_chats_group

Test 4: Simplified Connection Test

✓ Can connect to PostgreSQL server with your credentials
✓ Target database 'engrprimusapps_chats_group' exists

Test 5: System Information

PHP Version: 8.3.25
Operating System: Linux morty.heliohost.org 5.14.0-503.14.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 19 21:25:22 EST 2024 x86_64

Common Solutions

If connection is failing, try these solutions:

1. Check PostgreSQL Service:
• Make sure PostgreSQL is running on your server
• Check if it's listening on port 5432

2. Database Creation:
If the database doesn't exist, create it:
psql -U postgres -c "CREATE DATABASE engrprimusapps_chats_group;"

3. User Permissions:
Make sure the user has access to the database:
psql -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE engrprimusapps_chats_group TO engrprimusapps_devotions_prayers;"

4. pg_hba.conf Configuration:
Check if your PostgreSQL allows local connections in /etc/postgresql/*/main/pg_hba.conf

5. Alternative Configurations to Try:
• Use '127.0.0.1' instead of 'localhost'
• Check if PostgreSQL is running on a different port
• Verify the username and password are correct