PHP: using PHP 5.3.10 on an ubuntu vm through Vagrant DB: Postgres 9.3.2.0
I can easily connect to a remote DB; however, when I try to connect to a local dev DB I have, I get an error
new PDO("pgsql:dbname=testdb;host=127.0.0.1;user=user1;password=tester;port=5432");
[Mon Jun 08 21:37:15 2015] [error] [client 10.0.2.2] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[08006] [7] could not connect to server: Connection refused\n\tIs the server running on host "127.0.0.1" and accepting\n\tTCP/IP connections on port 5432?' in /lib/Db.inc:28\nStack trace:\n#0 /lib/Db.inc(28): PDO->__construct('pgsql:dbname=te...')\n#1 /www/page1.php(9): Db->__construct('postgres://test...')\n#2 {main}\n thrown in /lib/Db.inc on line 28
I know this isn't a connection issue since my local db is up and running fine
psql postgres://user1:[email protected]/testdb