Can not install Apache2::Const module - perl

I have installed Apache 2.2.25 with mod_perl 2.0.7 running on Debian 7.1.0. During its installation mod_perl had to install module named Apache2::Const, but it didn't. mod_perl have installed modules from the same group, e.g. Apache2::Access, Apache2::Connection, Apache2::RequestUtil.
So when I use this command (i /Apache2::Const/) in cpan shell it outputs following:
cpan[3]> i /Apache2::Const/
Module id = Apache2::ConstantsTable
CPAN_USERID PHRED (Fred Moyer <fred#redhotpenguin.com>)
CPAN_VERSION undef
CPAN_FILE P/PH/PHRED/mod_perl-2.0.8.tar.gz
UPLOAD_DATE 2013-04-18
INST_FILE (not installed)
And when I use this command (install Apache2::Const):
cpan[4]> install Apache2::Const
Warning: Cannot install Apache2::Const, don't know what it is.
Try the command
i /Apache2::Const/
to find objects with matching identifiers.
I've tried to run:
install Apache2::ConstantsTable
But it didn't help.
Also, when I run following script:
perl -e "use v5.14.2; use Apache2::Const"
it outputs:
Not a CODE reference at /usr/lib/perl/5.14/DynaLoader.pm line 207.
END failed--call queue aborted at /usr/local/lib/perl/5.14.2/ModPerl/Const.pm line 207.
Compilation failed in require at /usr/local/lib/perl/5.14.2/Apache2/Const.pm line 18.
BEGIN failed--compilation aborted at /usr/local/lib/perl/5.14.2/Apache2/Const.pm line 18.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
I tried to install this module manually (via Makefile.PL) from mod_perl package. I also tried to reinstall mod_perl. Nothing helped.
All the other Apache2::* modules works correctly.
I really need to install Apache2::Const module. Thanks for your replies.

Solved long time ago by installing all this stuff from debian package. I was hard noob in linux when I posted the question.

Related

Running perl test in intellij: Can't load module PassEnv at

I want to created perl modules in intellij derived by Tests. I created following test in a new project as shown below
#!/usr/bin/perl
use strict;
use warnings;
use Test::More;
done_testing();
But when i am trying to run the test (Shift+Alt+F10), it fails with below error
Testing started at 10:51 ...
C:/Strawberry/perl/bin\perl.exe C:/Strawberry/perl/bin/prove.bat -PPassEnv --formatter TAP::Formatter::Camelcade --merge --recurse --jobs 1 D:/workspace/code/repo/Modules/ImageUtilities/ReaConverterTest.t
Can't load module PassEnv at C:/Strawberry/perl/bin/prove.bat line 26.
Process finished with exit code 2
But when I run the test from the command line it works fine
$ perl -w ReaConverterTest.t
1..0
I see that there was an issue reported with intellij perl plugin(https://github.com/Camelcade/Perl5-IDEA/issues/1966) but it is closed. Looks like it was fixed in 2019.1 Perl but I am clueless why it's failing for me.
Any idea on how to fix this?
PS: I am using Git-Bash to run Perl scripts, IntelliJ using strawberry Perl installation on windows as Perl interpreter.
Update
When i run the script by adding "use PassEnv" it fails as there is no such module Searching from intellij also results in "no such module"
perl -w ReaConverter.t
Can't locate PassEnv.pm in #INC (you may need to install the PassEnv module) (#INC contain
s: /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/sha
re/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at ReaConverter.
t line 6.
BEGIN failed--compilation aborted at ReaConverter.t line 6.
Because of the -PPassEnv option used, prove attempts to load App::Prove::Plugin::PassEnv. It hasn't been installed. Simply install the module.
Note: You want to install it using Strawberry Perl, so the following appears to be the appropriate command from your preferred shell:
/c/Strawberry/perl/bin/cpanm App::Prove::Plugin::PassEnv

Installing cURL modules for Perl on Windows

I have ActivePerl 5.14.2 on my Windows machine. I have been trying to install the LWP cURL module. I have already installed the libcurl-dev library and GCC on my machine.
I also understand that LWP cURL has a dependency on the WWW-Curl-Easy module. So I installed that too. I installed all these through the command lines using the steps given in the Readme files. I ran the perl makefile.pl command followed by a make and a make install. No errors were given out during the installation.
I am trying to execute this sample code to test my LWP cURL installation:
use LWP::Curl;
use strict;
use warnings;
my $lwpcurl = LWP::Curl->new();
my $content = $lwpcurl->get('http://search.cpan.org','http://www.cpan.org');
I am receiving the below error:
Can't locate loadable object for module WWW::Curl in #INC (#INC
contains: C:/Perl64/site/lib C:/Perl64/lib .) at
C:/Perl64/site/lib/WWW/Curl.pm line 11. BEGIN failed--compilation
aborted at C:/Perl64/site/lib/WWW/Curl.pm line 11. Compilation failed
in require at C:/Perl64/site/lib/WWW/Curl/Easy.pm line 9. Compilation
failed in require at C:/Perl64/site/lib/LWP/Curl.pm line 5. BEGIN
failed--compilation aborted at C:/Perl64/site/lib/LWP/Curl.pm line 5.
Compilation failed in require at D:\Varsha\Curl.pl line 1. BEGIN
failed--compilation aborted at D:\Varsha\Curl.pl line 1.
Where am I going wrong?
This is probably not the direction you want to go, but I'd advise you to consider upgrading your perl and changing distributions:
Install Strawberry Perl - 5.18.2.2 is the currently recommended version.
Install cpanm: perl -MCPAN -e "install App::cpanminus"
Install LWP::Curl: cpanm LWP::Curl
I won't bother trying convince you of the change, but Strawberry Perl and cpanm in combination make installing modules a lot easier than having to dealing with the proprietary ppm's of ActivePerl in my opinion.
Just something to consider if you ever get tired of the occasional headaches.
The error means that WWW::Curl is either not installed or its path is not searchable (it's not in #INC). So the solutions are
Make sure that the module is installed.
Add the path where the module is installed to the #INC. Since you are on Windows, you can use set PERL5LIB = c:\path\to\dir
For a permanent solution follow the below:
Right-click My Computer and click Properties.
In the System Properties window, click on the Advanced tab.
In the Advanced section, click the Environment Variables button.
In the Environment Variables window in the "User variables for Foo Bar" section click on New and type in the following:
Variable name: PERL5LIB
Variable value: c:\path\to\dir
Then click OK 3 times. Windows that you open after this will already know about the new variable. Type this in the command window, to see the newly set value:
echo %PERL5LIB%
This will add the private /home/foobar/code directory (or c:\path\to\dir directory) to the beginning of #INC for every script that is executed in the same environment.
Also see: Installing perl dependency automatically in perl

Expect module not working in perl

I have installed expect module in perl at location C:\strawberry\perl\lib.
As a pre-requisite i have installed IO-Tty module first at same location were perl is installed.
Now if i am doing
use Expect;
It is throwing error
Can't locate IO/Pty.pm in #INC (#INC contains: C:/strawberry/perl/site/lib C:/st
rawberry/perl/vendor/lib C:/strawberry/perl/lib .) at C:/strawberry/perl/lib/Exp
ect.pm line 22.
BEGIN failed--compilation aborted at C:/strawberry/perl/lib/Expect.pm line 22.
Compilation failed in require at croak.txt line 1.
BEGIN failed--compilation aborted at croak.txt line 1.
Possible reasons are
Perl is looking for IO::Pty and IO::Tty module which are called from Expect.pm. But When i have installed IO::Tty module, it is having 2 pm files with names Pty.pm and Tty.pm
package Expect;
use IO::Pty 0.97; # We need make_slave_controlling_terminal()
use IO::Tty;
But perl is looking for IO::Tty module.
Is this causing the issue. If yes then how can i move forward
Expect does not work under Windows.
At least this is my impression when looking at CPAN Resters results. This table here:
http://matrix.cpantesters.org/?dist=Expect;maxver=1
shows that there was never a PASS for Expect under Windows.
Also, the Expect documentation talks about the module not working with ActivePerl and recommends to use cygwin instead:
https://metacpan.org/module/RGIERSIG/Expect-1.21/Expect.pod#Can-I-use-this-module-with-ActivePerl-on-Windows.
I assume that Expect does not work with StrawberryPerl, too.
Did you installed these modules using cpan? - I would highly recommend to install modules only via cpan, so you'll get all the dependencies needed.
If you've done so, try to reinstall it and watch out for any errors.
I tested the install via cpan and it needs to compile the IO::Tty package, so maybe you need to set-up an build environment for any perl modules you would like to install.
If you just copied some precompiled files verify that the files you're missing really exist and download the package again.
Edit:
What I missed - The full path for your Pty.pm and Tty.pm should be something like "C:/strawberry/perl/lib/IO/Tty.pm"

Module Installation errors when trying to use local::lib and CPAN

I am trying to use local::lib as I don’t have admin rights on the system and I want to download and install a local library. I ran following:
perl Makefile.PL --bootstrap
make test && make install
echo 'eval $(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)' >>~/.bashrc
After this I tried to download the Module via cpan
by running perl -MCPAN -e shell install netAddr::IP but when i am running my program it's giving an error:
Can't locate NetAddr/IP.pm in #INC (#INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at agha.pl line 8.
BEGIN failed--compilation aborted at agha.pl line 8.
I took that to mean the module is not installed... So I again tried to go through CPAN, but now it's giving an error (this is in Linux):
-bash-3.2$ perl -MCPAN -e shell
There seems to be running another CPAN process (pid 15611). Contacting...
Other job is running.
You may want to kill it and delete the lockfile, maybe. On UNIX try:
kill 15611
rm /homes/ar312/.cpan/.lock
From the local::lib documentation:
After writing your shell configuration file, be sure to re-read it to get the changed settings into your current shell's environment.
You forgot to do so.
In all seriousness, save yourself a ton of time and trouble by installing perlbrew.
perlbrew is a tool to manage multiple perl installations in your $HOME directory. They are completely isolated perl universes. This approach has many benefits:
No need to run sudo to install CPAN modules, any more.
Try the monthly released new perls.
Learn new language features.
Test your production code against different perl versions.
Leave vendor perl (the one that comes with OS) alone

Why does Perl say that it can't find my module?

I wanted to play with XML::Rabbit, however I've got a problem even with the simplest code. I managed to strip this into one line.
In a simple file, I use
use Class::Load;
and then:
perl test_optlist.pl
Can't locate Data/OptList.pm in #INC (you may need to install the Data::OptList module) (#INC contains: [CUT]) at /home/szymon/perl5/lib/perl5/Class/Load.pm line 8.
BEGIN failed--compilation aborted at /home/szymon/perl5/lib/perl5/Class/Load.pm line 8.
Compilation failed in require at test_optlist.pl line 2.
BEGIN failed--compilation aborted at test_optlist.pl line 2.
so let's install it:
$ cpanm Data::OptList
Data::OptList is up to date. (0.107)
Perl version:
This is perl 5, version 17, subversion 8 (v5.17.8) built for x86_64-linux
Where is the problem?
You're surely using another perl's cpanm. Do
perlbrew install-cpanm
to install a version of cpanm under perlbrew's control, make sure this new cpanm is the one found first in the path (though I suspect it will be), then try again