Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't locate Apache/Session/Generate/MD5.pm

Status
Not open for further replies.

LocoPollo

Programmer
Jun 6, 2005
48
DK
This ia a Perl/Apache/XP problem.

I have tried to install the MD5 module using PPM, and when I make "query *" the MD5 is there.

I have also tried to download it and install it this way:
cd Apache-Session-1.6
perl Makefile.PL
make
make test
make install
- the "make" stuff doesn't work though, not with "nmake" either.

But when I try to run a script in PerlEditor, it says:
Can't locate Apache/Session/Generate/MD5.pm in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at login.pl line 6.

I'm not even sure I know what this mean - the @INC thing, and wether its a Apache or Perl problem.

What can I do? and is there a way to check what modules are installed on apache? is there a command or something?
 
Its perl.
The array @INC contains all the two paths you see.
In there it tries to find the module you installed.
So if you use in your script something like this
[blue]Apache::Session::Generate::MD5[/blue]
then perl is searching for the module in these two locations

C:/Perl/lib/Apache/Session/Generate/MD5.pm
C:/Perl/site/lib/Apache/Session/Generate/MD5.pm

If you module was installed somewhere else it will never find it to load it for use from your script.

Search your folders for the file MD5.pm
Hopefully you will find it somewhere. Lets say [blue]c:\foo\whatever\somewhere\Apache\Session\Generate\MD5.pm[/blue]

Now what you can do is in your script before that line
Code:
use Apache::Session::Generate::MD5
add this line
Code:
push (@INC,'c:\foo\whatever\somewhere');


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
Thanks!! it almost worked.

When I did a search for the MD5.pm, I found it two places:

C:\Perl\lib\Digest
C:\Perl\site\lib

I got a bit desperate, so I tried to, manually make a folder with the path you mentioned, and copied everything I could find with the name of MD5 (and everything in the folders where I found the MD5.pm's) to these folders:

C:\Perl\lib\Apache\Session\Generate
C:\Perl\site\lib\Apache\Session\Generate

Now I dont get the @INC message anymore, but instead it says:
Undefined subroutine &Apache::Session::Generate::MD5::generate called at Untitled line 6.
... when I run a script like the one below.

Code:
#!/usr/bin/perl
print "Content-type: text/html\n\n";

use strict;
use Apache::Session::Generate::MD5;
my $id = Apache::Session::Generate::MD5::generate();

print "<html><h1>$id</h1></html>\n";

Any ideas? I prefer not to use the "push (@INC,'c:\foo\whatever\somewhere');" since I afterwords most likely will have to upload the script to a FreeBSD/Linux server on the net.

Thanks alot!!!
 
Forget what i told you before.
Let me ask, Did you install the module Apache::Session ?
Cause if you say that the nmake doesn't work then it is notinstalled.

if you didn't it will never work

If you donwload the MD5 module, you have to know that has nothing to do with the Apache::Session::Generate::MD5 module.

The second one to work you have to install the following modules first:

Apache::Session
Apache::Session::Generate
and then
Apache::Session::Generate::MD5

The module you find in those two locations is the MD5 module.
Is not the Apache::Session::Generate::MD5 module

I would suggest you use you PPM to install the modules
And if PPM cannot find a ppd file for the packages, then you have to use cpan.


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
This makes me nuts... :(
The PPM: DBI was so easy to install, no problems.

When I search my PPM, there is no "apache session", so I went to cspan:


and no matter what package I look at it is the "Apache-Session-1.6" package that I'm going to download.

How do I install them step by step when its the same installation package.
 
If you have installed on your windows the VisualSudio 6 'which is not free'(not .Net)
then you have a good C compiler to compile all modules from cpan.
And you can do that by openning a cmd and on your prompt
Code:
c:\> perl -MCPAN -e shell

cpan> install This::Module

If you don't, then you have to install cygwin 'which is free', then you can use the same command from your cygwin prompt.

If you don't have neither of these, then you have to find a C compiler for windows, to use when you want to install modules manually (with nmake).

Otherwise (specially for Apache::modules) you can find find a binary setup package for windows which will install Apache on you windows with mod_perl (which will definitely install the Apache::Modules with it)

If you don't have a C compiler then the only modules you will be able to compile are those who use only Makefile.pl and they don't include any c header files or other c files like *.h or *.xs or *.c inside their package.

I hope I didn't make your day a hell!
They is much more to learn so ......Lets take it step by step.
This was the first....Whatever problem....google it.
And if you can't find anything then ask me.
I'll be here.


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top