Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Apache Perl CGI environment question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Apache Perl CGI environment question




Hello, all ...

I am sending this to both darwin-dev and darwinos-users because this question kiind of straddles the fence, me thinks. It's a simple one, though.

I have some Perl code that uses the DBD::Pg (PostgreSQL DBI interface) module. This code runs fine under OSX 10.3.7 using mod_perl as long as I add this to httpd.conf:

PerlSetEnv PERL5LIB /sw/lib/perl5/5.8.1/darwin-thread-multi-2level

... which I need to do because, while the CPAN module for DBD::Pg fails to install under Panther, the Fink package for it indeed works. It's just that Fink puts it in a different directory (/sw) so I need to tell Apache and mod_perl to add that directory to @INC so that the Perl code will find it. This all works wonderfully.

However, now I need to forsake mod_perl and make this also work for plain CGI. As far as I can tell, there doesn't seem to be a way to specify additional directories to be added to @INC (via PERL5LIB or otherwise). This has to work under multiple platforms (Mac OSX, Debian Linux and Cygwin) so changing the Perl code is out of the question. So, i'm wondering how to do this.

1. I could somehow alter the way OSX starts up Apache so the /sw/... directory is added ...
2. ???

I want to keep things as similar and parsimonious as I can across platforms i.e. I don't want to use some elaborate hack to do it only for one platform, when the others don't need to ...

Can anyone help?

Regards,

John

Falling You - exploring the beauty of voice and sound
New album, "Touch", available now
http://www.magnatune.com/artists/falling_you










 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.