: This article describes how to connect php to postgreSql. if you are interested in the PHP Tutorial, refer to it. Environment: wampserver64 php5.5.12
1. remove the comma before extension = php_pdo_pgsql.dll and extension = php_pgsql.dll in the php. ini file;
2. set. /php/libpq. dll (libpq in the php folder. dll) and. /php/ext/php_pgsql.dll (php_pgsql.dll under the ext folder) php_pdo_pgsql.dll copy the three dll files to the C drive system32
3. under normal circumstances, php can connect to IPVs, but I still encounter an error, prompting "Fatal error: Call to undefined function pg_connect ()", viewing Apache logs, "PHP Startup: unable to load dynamic library '***** \ PHP5 \ ext \ php_pdo_pgsql.dll ".
After searching, add LoadFile "***/PHP5/libpq. dll" to the configuration file httpd. conf in the conf folder of Apache, which is located after LoadModule.
(*** Is the php Installation Path)
4. test code
Link: http://www.cnblogs.com/FlyFive/archive/2013/03/11/2954686.html
Http://blog.csdn.net/yageeart/article/details/6674296
The above describes how to connect php to postgreSql, including related content, and hope to help those who are interested in PHP tutorials.