pdo_pgsql and php on mac os x yosemite -
so compiled pdo_pgsql source , added extension php.ini
phpinfo()
says
pdo pdo support enabled pdo drivers mysql, sqlite, pgsql pdo_pgsql pdo driver postgresql enabled postgresql(libpq) version 9.4.2 module version 1.0.2
but
pg_connect("host=localhost dbname=dbname user=username password=password")
gives
call undefined function pg_connect()
yes, did restart apache.
server_software apache/2.4.10 (unix) php/5.5.20
i on mac os x yosemite 10.10.3
thanks!
how make connection so:
try { $conn = new pdo('pgsql:host=localhost;port=port-number;dbname=database','db-user','db-pass'); $conn->query("set names utf8"); } catch (pdoexception $e) { die('connection failed: ' . $e->getmessage()); }
Comments
Post a Comment