Php connection to postgreSql

Source: Internet
Author: User
: 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.