Closed Bug 794196 Opened 13 years ago Closed 10 years ago

[PostgreSQL] On Windows, Bugzilla is unable to load Pg.dll

Categories

(Bugzilla :: Installation & Upgrading, defect)

4.2.1
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 987742

People

(Reporter: br_bugzilla, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.5) Gecko/20100101 Firefox/10.0.5 Build ID: 20120531185831 Steps to reproduce: Installed Bugzilla 4.2.1 on Windows 7 (64 bit) using Apache 2.2.22, Perl 5.14.2, and PostgreSQL 9.1.4. In web browser (Firefox 10.0.5) navigate to http://..../bugzilla Actual results: Browser displays Software error: 'Pg' is not a valid choice for $db_driver in localconfig: Can't load 'C:/Perl5.14.2/site/lib/auto/DBD/Pg/Pg.dll' for module DBD::Pg: load_file:The specified module could not be found at C:/Perl5.14.2/lib/DynaLoader.pm line 190. at Bugzilla/DB/Pg.pm line 47 Compilation failed in require at Bugzilla/DB/Pg.pm line 47. BEGIN failed--compilation aborted at Bugzilla/DB/Pg.pm line 47. Compilation failed in require at (eval 950) line 2. For help, please send mail to the webmaster (xxx@yyy.com), giving this error message and the time and date of the error. Expected results: The Bugzilla "start" page should appear. Have determined that the problem is due to Windows searching for DLL using the "PATH" environment variable which is set to '' (empty string) in the Bugzilla.pm file (part of the TAINT safety requirements). My fix: In Bugzilla.pm change if (${^TAINT}) { # Some environment variables are not taint safe delete @::ENV{'PATH', 'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; # Some modules throw undefined errors (notably File::Spec::Win32) if # PATH is undefined. $ENV{'PATH'} = ''; } to: if (${^TAINT}) { # Some environment variables are not taint safe delete @::ENV{'PATH', 'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; # Some modules throw undefined errors (notably File::Spec::Win32) if # PATH is undefined. $ENV{'PATH'} = ''; my $lib_path = $ENV{'LD_LIBRARY_PATH'}; if ($lib_path ne '') { $ENV{'PATH'} = $lib_path ; } } And in the Apache httpd.conf file add this: SetEnv LD_LIBRARY_PATH "C:\Program Files\PostgreSQL\9.1\bin"
A more succinct edit makes use of the ON_WINDOWS constant from Constants.pm: In Bugzilla.pm change if (${^TAINT}) { # Some environment variables are not taint safe delete @::ENV{'PATH', 'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; # Some modules throw undefined errors (notably File::Spec::Win32) if # PATH is undefined. $ENV{'PATH'} = ''; } to: if (${^TAINT}) { # Some environment variables are not taint safe delete @::ENV{'PATH', 'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; # Some modules throw undefined errors (notably File::Spec::Win32) if # PATH is undefined. $ENV{'PATH'} = ON_WINDOWS ? $ENV{'LD_LIBRARY_PATH'} : ''; }
Summary: On Windows, Bugzilla is unable to load DLL → [PostgreSQL] On Windows, Bugzilla is unable to load Pg.dll
Could you test again with Bugzilla 5.0.2? This problem is supposed to be fixed now. At least, it's working fine for me using PostgreSQL 9.5.1 and Strawberry Perl 5.22.1.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.