Skip site navigation (1) Skip section navigation (2)

apache perl cgi script cant load libpq.5.dylib on mac os tiger

From: Fergus McMenemie <fergus(at)twig(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: apache perl cgi script cant load libpq.5.dylib on mac os tiger
Date: 2008-05-23 15:05:31
Message-ID: p06240800c45c8aeb39c5@[] (view raw, whole thread or download thread mbox)
Lists: pgsql-general
I have a perl cgi script that wont run on a new mac.  The script runs fine
from the command line, so the perl and postgresql seem good. However
when run as an apache cgi script the postgresql stuff fails as shown
below.  I altered the script to dump %ENV and the paths seem in order.

The script is not using mod perl. It is using the apple os x 10.4.11 supplied
version of apache, postgresql-8.3.0  and perl, v5.8.8 with DBD::Pg, DBI and
JSON installed.

I am at a total loss as to why the library cant be found and would be
very grateful for any help.

Content-type: text/html Software error:

install_driver(Pg) failed:
   Can't load '/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/DBD/Pg/Pg.bundle'
  for module DBD::Pg: dlopen(/usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/DBD/Pg/Pg.bundle, 1):
  Library not loaded: /usr/local/pgsql/lib/libpq.5.dylib
  Referenced from: /usr/local/lib/perl5/site_perl/5.8.8/darwin-2level/auto/DBD/Pg/Pg.bundle
  Reason: image not found at /usr/local/lib/perl5/5.8.8/darwin-2level/ line 230.
 at (eval 45) line 3
  Compilation failed in require at (eval 45) line 3.
Perhaps a required shared library or dll isn't installed where expected at /Library/WebServer/cgi-bin/ line 383

     $ENV{AUTH_TYPE} = Basic
     $ENV{DOCUMENT_ROOT} = /Library/WebServer/Documents
     $ENV{DYLD_LIBRARY_PATH} = /usr/local/pgsql/lib:/usr/lib:/usr/local/lib
     $ENV{HTTPS} = on
     $ENV{HTTP_ACCEPT} = text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,/;q=0.5
     $ENV{HTTP_ACCEPT_CHARSET} = ISO-8859-1,utf-8;q=0.7,;q=0.7
     $ENV{HTTP_ACCEPT_ENCODING} = gzip,deflate
     $ENV{HTTP_ACCEPT_LANGUAGE} = en,en-us;q=0.5
     $ENV{HTTP_CONNECTION} = keep-alive
     $ENV{HTTP_HOST} =
     $ENV{HTTP_KEEP_ALIVE} = 300
     $ENV{HTTP_USER_AGENT} = Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: Gecko/20080404 Firefox/
     $ENV{LD_LIBRARY_PATH} = /usr/local/pgsql/lib:/usr/lib:/usr/local/lib
     $ENV{PATH} = /usr/local/pgsql/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin
     $ENV{REMOTE_PORT} = 53698
     $ENV{REMOTE_USER} = fergus
     $ENV{REQUEST_URI} = /cgi-bin/
     $ENV{SCRIPT_FILENAME} = /Library/WebServer/cgi-bin/
     $ENV{SCRIPT_NAME} = /cgi-bin/
     $ENV{SERVER_ADMIN} = fergus(at)XXXXX
     $ENV{SERVER_PORT} = 443
     $ENV{SERVER_SIGNATURE} =  Apache/1.3.41 Server at Port 443
     $ENV{SERVER_SOFTWARE} = Apache/1.3.41 (Darwin) mod_ssl/2.8.31 OpenSSL/0.9.7l


Fergus McMenemie               Email:fergus(at)twig(dot)me(dot)uk
Techmore Ltd                   Phone:(UK) 07721 376021

Unix/Mac/Intranets             Analyst Programmer


pgsql-general by date

Next:From: Ivan ZolotukhinDate: 2008-05-23 15:35:43
Subject: Re: tsearch2 on-demand dictionary loading & using functions in tsearch2
Previous:From: Stephen FrostDate: 2008-05-23 14:41:50
Subject: Re: Using role priviledges for pg_dump

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group