You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ed Bachmann <ed...@unc.edu> on 2004/06/01 21:52:58 UTC

[users@httpd] perl module libraries - cgi under MS Windows

I using CGI with ActiveState perl 5.8.3 build 809 under Apache/2.0.49 under 
MS Windows 2000 SP4.

The trouble I am having is that perl can only find perl modules in certain 
locations.
The default @INC contains:
@INC:
 C:/Perl/lib
C:/Perl/site/lib
.

Perl finds modules in
c:\Program Files\Apache Group\Apache2\cgi-bin
when no ‘use lib’ statement is used.

If the modules are moved here:
c:/lib/perl,
it finds them when this ‘use lib’ statement is used:
use lib qw( c:/lib/perl );

If the modules are moved here:
c:/Program Files/Apache Group/Apache2/cgi-bin/lib/perl,  or here:
c:/Program Files/Apache Group/Apache2/lib/perl,
the script fails on the ‘use module_name.pm;’ statement with these errors:
“... Premature end of script headers ...”
“... Can't locate module_name.pm in @INC
(@INC contains: c:/dir_specified_in_use_lib C:/Perl/lib C:/Perl/site/lib .) 
...”,
even with the appropriate ‘use lib’ specification.

This same problem occurs if I try to access the modules on a remote machine 
over our network, which is what I would really like to do.

My questions are:

Do perl modules have to reside on the server?

If so, do they have to be either outside the server root or, if under the 
server root, directly under cgi-bin, not in a sub-directory under cgi-bin?

If not, what am I doing wrong?

httpd.conf has these setting:

ServerRoot  "C:/Program Files/Apache Group/Apache2"

ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache2/cgi-bin/"

<Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
    AllowOverride None
	Options None
	Order deny,allow
	Deny from all
	Allow from .irss.unc.edu
</Directory>

I’m new to Apache, all ideas welcome.
Thanks,
Ed Bachmann

Odum Institute for Research in Social Science
Manning Hall  CB 3355
University of North Carolina
Chapel Hill, NC  27599-3355

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org