These are the steps I took:
1) Installed Perl 5.10 from ActiveState (http://www.activestate.com/activeperl/)
2) Installed PostgreSQL v8.4 using Enterprise DB one-click installer (http://www.enterprisedb.com/products/pgdownload.do#windows)
3) Installed Apache HTTP Server v2.2.13 (http://httpd.apache.org/)

All of these are up and running correctly; tested Perl programs, loaded/queried tables in Postgres, and can access pages using http://localhost. Postgres and Perl were installed to C:\Program Files and Apache is on a different partition.

I added a bunch of repositories and installed DBD::Pg using the ActivePerl PPM - everything seemed to be fine, but when I go to connect to Postgres, I'm getting a weird error.

This is the error I get:
install_driver(Pg) failed: Can't load 'C:/Program Files/Perl/site/lib/ +auto/DBD/Pg/Pg.dll' for module DBD::Pg: load_file:The specified modul +e could not be found at C:/Program Files/Perl/lib/DynaLoader.pm line +201. at (eval 8) line 3

I tried installing from the command prompt "cpan> install DBD::Pg", but I get weird errors like the libpq not installed, when libpq.dll does exist. Windows sucks @ installing open source stuff (or I just suck at installing it). I know my script works, because I use it on a Linux box.

I would sure like assistance if anyone could give it. I think I had this working in the past, but that was when I installed the programs to the default directories (not Program Files).

Result of trying to run from cpan command line:
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\vol7ron>perl cpan Can't open perl script "cpan": No such file or directory C:\Documents and Settings\vol7ron>cpan Set up gcc environment - 3.4.5 (mingw-vista special r3) cpan shell -- CPAN exploration and modules installation (v1.9402) Enter 'h' for help. cpan> install DBD::Pg Fetching with LWP: http://ppm.activestate.com/CPAN/authors/01mailrc.txt.gz Going to read 'C:\Program Files\Perl\cpan\sources\authors\01mailrc.txt +.gz' ...................................................................... +......DONE Fetching with LWP: http://ppm.activestate.com/CPAN/modules/02packages.details.txt.gz Going to read 'C:\Program Files\Perl\cpan\sources\modules\02packages.d +etails.txt .gz' Database was generated on Fri, 04 Sep 2009 09:27:08 GMT ...................................................................... +......DONE Fetching with LWP: http://ppm.activestate.com/CPAN/modules/03modlist.data.gz Going to read 'C:\Program Files\Perl\cpan\sources\modules\03modlist.da +ta.gz' ...................................................................... +......DONE Going to write C:\Program Files\Perl\cpan\Metadata Running install for module 'DBD::Pg' Running make for T/TU/TURNSTEP/DBD-Pg-2.15.1.tar.gz Fetching with LWP: http://ppm.activestate.com/CPAN/authors/id/T/TU/TURNSTEP/DBD-Pg-2.15 +.1.tar.gz Fetching with LWP: http://ppm.activestate.com/CPAN/authors/id/T/TU/TURNSTEP/CHECKSUMS Checksum for C:\Program Files\Perl\cpan\sources\authors\id\T\TU\TURNST +EP\DBD-Pg- 2.15.1.tar.gz ok Scanning cache C:\Program Files\Perl/cpan/build for sizes DONE DBD-Pg-2.15.1/ DBD-Pg-2.15.1/quote.h DBD-Pg-2.15.1/.perlcriticrc DBD-Pg-2.15.1/TODO DBD-Pg-2.15.1/README DBD-Pg-2.15.1/types.c DBD-Pg-2.15.1/Changes DBD-Pg-2.15.1/Makefile.PL DBD-Pg-2.15.1/t/ DBD-Pg-2.15.1/t/00basic.t DBD-Pg-2.15.1/t/08async.t DBD-Pg-2.15.1/t/01constants.t DBD-Pg-2.15.1/t/03smethod.t DBD-Pg-2.15.1/t/01connect.t DBD-Pg-2.15.1/t/03dbmethod.t DBD-Pg-2.15.1/t/06bytea.t DBD-Pg-2.15.1/t/02attribs.t DBD-Pg-2.15.1/t/04misc.t DBD-Pg-2.15.1/t/lib/ DBD-Pg-2.15.1/t/lib/App/ DBD-Pg-2.15.1/t/lib/App/Info.pm DBD-Pg-2.15.1/t/lib/App/Info/ DBD-Pg-2.15.1/t/lib/App/Info/RDBMS/ DBD-Pg-2.15.1/t/lib/App/Info/RDBMS/PostgreSQL.pm DBD-Pg-2.15.1/t/lib/App/Info/Util.pm DBD-Pg-2.15.1/t/lib/App/Info/Request.pm DBD-Pg-2.15.1/t/lib/App/Info/Handler.pm DBD-Pg-2.15.1/t/lib/App/Info/Handler/ DBD-Pg-2.15.1/t/lib/App/Info/Handler/Prompt.pm DBD-Pg-2.15.1/t/lib/App/Info/RDBMS.pm DBD-Pg-2.15.1/t/dbdpg_test_setup.pl DBD-Pg-2.15.1/t/20savepoints.t DBD-Pg-2.15.1/t/07copy.t DBD-Pg-2.15.1/t/09arrays.t DBD-Pg-2.15.1/t/00-signature.t DBD-Pg-2.15.1/t/12placeholders.t DBD-Pg-2.15.1/t/99cleanup.t DBD-Pg-2.15.1/dbivport.h DBD-Pg-2.15.1/Pg.h DBD-Pg-2.15.1/dbdimp.c DBD-Pg-2.15.1/quote.c DBD-Pg-2.15.1/META.yml DBD-Pg-2.15.1/lib/ DBD-Pg-2.15.1/lib/Bundle/ DBD-Pg-2.15.1/lib/Bundle/DBD/ DBD-Pg-2.15.1/lib/Bundle/DBD/Pg.pm DBD-Pg-2.15.1/Pg.xs DBD-Pg-2.15.1/README.win32 DBD-Pg-2.15.1/win32.mak DBD-Pg-2.15.1/MANIFEST DBD-Pg-2.15.1/SIGNATURE DBD-Pg-2.15.1/Pg.pm DBD-Pg-2.15.1/MANIFEST.SKIP DBD-Pg-2.15.1/README.dev DBD-Pg-2.15.1/dbdimp.h DBD-Pg-2.15.1/types.h CPAN.pm: Going to build T/TU/TURNSTEP/DBD-Pg-2.15.1.tar.gz Set up gcc environment - 3.4.5 (mingw-vista special r3) Configuring DBD::Pg 2.15.1 Path to pg_config? c:\Program Files\PostgreSQL\8.4\bin\pg_config.exe PostgreSQL version: 80400 (default port: 5432) POSTGRES_HOME: (not set) POSTGRES_INCLUDE: c:/PROGRA~1/POSTGR~1/8.4/include POSTGRES_LIB: c:/PROGRA~1/POSTGR~1/8.4/lib OS: MSWin32 *** Warning: whitespace characters in the current directory path (C:/P +rogram Fil es/Perl/cpan/build/DBD-Pg-2.15.1-9RDqNH) may cause problems Checking if your kit is complete... Looks good Unable to find a perl 5 (by these names: C:\Program Files\Perl\bin\per +l.exe perl .exe perl5.exe perl5.10.1.exe miniperl.exe, in these dirs: . C:\Progra +m Files\Pe rl\site\bin C:\Program Files\Perl\bin C:\Perl\site\bin C:\Perl\bin C:\ +WINDOWS\sy stem32 C:\WINDOWS C:\WINDOWS\System32\Wbem C:\Program Files\QuickTime\ +QTSystem\ C:\WINDOWS\system32\WindowsPowerShell\v1.0 C:\Program Files\Microsoft +SQL Server \90\Tools\binn\ C:\Program Files\Perl\bin) Note (probably harmless): No library found for -lpq Using DBI 1.607 (for perl 5.010001 on MSWin32-x86-multi-thread) instal +led in C:/ Program Files/Perl/lib/auto/DBI/ Writing Makefile for DBD::Pg ========================================================== WARNING! No libpq libraries were detected! You need to install the postgresql-libs package for your system, or set the POSTGRES_LIB environment variable to the correct place. Removing (Makefile) =========================================================== Warning: No success on command["C:\Program Files\Perl\bin\perl.exe" Ma +kefile.PL INSTALLDIRS=site] TURNSTEP/DBD-Pg-2.15.1.tar.gz "C:\Program Files\Perl\bin\perl.exe" Makefile.PL INSTALLDIRS=site -- + NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install Failed during this command: TURNSTEP/DBD-Pg-2.15.1.tar.gz : writemakefile NO '"C:\ +Program Fi les\Perl\bin\perl.exe" Makefile.PL INSTALLDIRS=site' returned status 2 +56

In reply to Installing DBD::Pg on Windows XP Pro 32b by deMize

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.