Re: Offtopic: Add Path to @INC

Byron Brummer (byron@omix.com)
Thu, 7 Oct 1999 15:28:16 -0700 (PDT)


Rolf Meinecke <meinecke@gmx.net> wrote:
> Due to an upgrade from SuSE 6.1 to SuSE 6.2 our Apache strangely
> lacked of libperl.so and libphp3.so. I FTPed these files from another
> machine, but on 'rcapache restart' I get the following error:
> 
> felix:/etc/httpd # [Thu Oct  7 11:10:08 1999] [error] Can't locate
> Apache.pm in @INC (@INC contains: /usr/lib/perl5/5.00503/i586-linux
> /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i586-linux
> /usr/lib/perl5/site_perl/5.005 . /usr/local/httpd/
> /usr/local/httpd/lib/perl) at (eval 1) line 3.
> 
> Apache.pm is in:
> 
> felix:/etc/httpd # locate Apache.pm
> /usr/lib/perl5/5.00503/CGI/Apache.pm
> 
> How can I add the path /usr/lib/perl5/5.00503/CGI/ to @INC?

	No, that's CGI::Apache (aka CGI/Apache.pm), not Apache (Apache.pm).

	Short term fix:
		You need to (re)install mod_perl, all of it, as a DSO.
		FTPing pieces of it on an as-needed basis will cause you
		nothing but pain.

	Long term solution:
		Go tell those fools at SuSE to stick site_perl
		in a non-system location such as
		/usr/local/lib/perl5/site_perl/5.005.  Or if they
		don't, you should install perl from source properly
		yourself.  Failing to keep your site_perl out of the
		system directories will likely result in the same problem
		you have right now every time you upgrade the OS.

	Reason:
		From looking at your @INC, it looks like SuSE is braindead
		when it comes to handling perl installs.  Perl seems to be a
		system tool as it is under /usr, which is fine, however SuSE
		seems to have foolishly put perl's site_perl directory under
		/usr/lib which implies that user added components (eg,
		Apache/mod_perl) are also part of the system.  Chances are
		when you upgraded SuSE it simply nuked /usr/lib entirely and
		put in its new versions.
		
	If you're going to have perl as a core system tool, the @INC should
	look something similar to this:

	@INC:
		/usr/libdata/perl/5.00503/mach
		/usr/libdata/perl/5.00503
		/usr/local/lib/perl5/site_perl/5.005/i386-freebsd
		/usr/local/lib/perl5/site_perl/5.005
		.

	Which is taken from a recent FreeBSD install, BTW.

-- 
-Zenin (zenin@archive.rhps.org)

        Yah, Emacs is a good OS, but I prefer FreeBSD.