LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   SOLUTION: Apache.pm not found in @INC - RH8, 9 and Mandy (https://www.linuxquestions.org/questions/linux-software-2/solution-apache-pm-not-found-in-%40inc-rh8-9-and-mandy-60534/)

sewer_monkey 05-18-2003 06:14 PM

SOLUTION: Apache.pm not found in @INC - RH8, 9 and Mandy
 
Hiya all! Ever get this kinda error message in Apache when trying to run a perl script that uses CGI.pm?
Code:

Can't locate Apache.pm in @INC (@INC contains: ...... )
Well, in case you're having difficulty with your server like I did, just do the following (worked for me like a charm)! Change your perl.conf file (on RH8 or 9 it's in /etc/httpd/conf.d/) to look like something this:
Code:

LoadModule perl_module modules/mod_perl.so

<FilesMatch "\.(pl|perl)$">
    SetHandler perl-script
    #PerlHandler ModPerl::Registry::handler
    PerlResponseHandler ModPerl::Registry
    PerlOptions +ParseHeaders
</FilesMatch>

Note how I commented out PerlHandler and replaced it with a PerlResponseHandler directive. That straightened things out. Not sure why, hitting the "books" now... :study: ;)

shrisak 07-22-2003 04:14 PM

RedHat 9.0 CGI Solution
 
Can't locate CGI.pm in @INC

This is the message I would get after doing an initial installation of RedHat 9.0, with Perl installed. It appeared that everything was installed, but I could not run any scripts!! Finally, I found the answer with some help on this board.

Here it is:
Note: You need to be connected to the internet, so you can access CPAN.



Type these commands for the Terminal (Command Prompt):

perl -MCPAN -e shell

install CGI.pm

i /CGI.pm/

Then you should see some listing like the line below.


This is the line that really does the work and sometimes, it takes a few tries, so try it a couple times until it works.!


install L/LD/LDS/CGI.pm-2.98.tar.gz


Now you should have the CGI.pm file installed that is required, as well as all the others.

Start running some CGI-Perl Scripts!

sewer_monkey 07-22-2003 05:47 PM

UPDATE: Note that RedHat comes with mod_perl for perl scripts. This is NOT the same as running mod_php for PHP scripts! Use mod_perl only if you have to! There are some really serious issues with mod_perl.

If you don't absolutely need mod_perl, use perl in CGI mode.


All times are GMT -5. The time now is 08:25 PM.