-1

I have a problem with Session on Perl.

I am trying to fix this error

perl -e "use Session;"
Can't locate Session.pm in @INC (you may need to install the Session module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1. " 

I am using Debian 8 64x Server.

I tried:

root@division:/usr/lib/cgi-bin# apt-get install libapache-session-perl
Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache-session-perl is already the newest version. 

and

perl -MCPAN -e shell
install Session

and

perl -MCPAN -e shell
cpan[1]> install Apache::Session
Reading '/root/.cpan/Metadata'
Database was generated on Mon, 29 May 2017 13:41:02 GMT

Apache::Session is up to date (1.93).

but still I have the same problem


Some information:

# echo 'o conf' | perl -MCPAN -e shell | grep -P '^\s+(make|mbuild)'
    make               []
    make_arg           []
    make_install_arg   []
    make_install_make_command []
    makepl_arg         [INSTALLDIRS=site]
    mbuild_arg         []
    mbuild_install_arg []
    mbuild_install_build_command [./Build]
    mbuildpl_arg       [--installdirs site]

# set | grep '^PERL'

# perl -le'print for @INC'
/etc/perl
/usr/local/lib/x86_64-linux-gnu/perl/5.20.2
/usr/local/share/perl/5.20.2
/usr/lib/x86_64-linux-gnu/perl5/5.20
/usr/share/perl5
/usr/lib/x86_64-linux-gnu/perl/5.20
/usr/share/perl/5.20
/usr/local/lib/site_perl
Borodin
  • 126,100
  • 9
  • 70
  • 144
  • `libapache-session-perl` [installs the `Apache::Session` module](https://packages.debian.org/sid/all/libapache-session-perl/filelist). – mob May 29 '17 at 16:22
  • Where did `cpan` install the module? – choroba May 29 '17 at 16:29
  • root@division:/usr/lib/cgi-bin# apt-get install libapache-session-perl Reading package lists... Done Building dependency tree Reading state information... Done libapache-session-perl is already the newest version. – Ricardo Marques May 29 '17 at 16:46
  • cpan[1]> install Apache::Session Reading '/root/.cpan/Metadata' Database was generated on Mon, 29 May 2017 13:41:02 GMT Apache::Session is up to date (1.93). – Ricardo Marques May 29 '17 at 16:48
  • Which module are you trying to install? Session or Apache::Session??? – ikegami May 29 '17 at 17:06
  • i am trying to fix this error "perl -e "use Session;" Can't locate Session.pm in @INC (you may need to install the Session module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at -e line 1. BEGIN failed--compilation aborted at -e line 1. " – Ricardo Marques May 29 '17 at 17:12
  • @ikegami trying to resolve my error. but no sucess. – Ricardo Marques May 29 '17 at 17:33
  • 1
    Then why do you keep installing Apache::Session instead of Session? What output do you get for `perl -MCPAN -e shell` + `install Session` – ikegami May 29 '17 at 18:24
  • perhaps try install CGI::Session http://search.cpan.org/~markstos/CGI-Session-4.48/lib/CGI/Session.pm – Gerhard May 30 '17 at 05:41

1 Answers1

0

The error you are getting is:

Can't locate Session.pm in @INC (you may need to install the Session module)

As the message says, the solution to this problem is to install the Session module from CPAN. For some reason, you have tried to solve it by installing the Apache::Session module from CPAN. Session and Apache::Session are two completely different modules. You cannot expect to solve a missing module problem by installing the wrong module.

(Although, I see that Session is a thin wrapper around Apache::Session - so you will need the Apache::Session module installed as well.)

I suggest that you install Session in order to fix your problem.

However, I should point out that the Session module has a single release (version 0.01) which was released in 2003, by someone who hasn't released anything to CPAN since 2005. I'd, therefore, suggest that the chances of getting any support for this module are tiny and I would recommend avoiding the module if at all possible.

Dave Cross
  • 68,119
  • 3
  • 51
  • 97