CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Adding modules to cgi-bin

 



Jean
User


Feb 12, 2002, 3:51 AM

Post #1 of 9 (1332 views)
Adding modules to cgi-bin Can't Post

Hi All,



I'm trying to run some CGI script that uses several modules that are not installed on the web server.

I've tried copying the modules to the cgi-bin (where the script is located),

like cgi-bin/XML/Parser for use XML::Parser; and this doesn't work for me.

Please note:

1. The script is runnig smoothly on local Win2K Apache

2. Although I understand Perl well enough as a language for stand-alone scripts, I'm barely familiar and totally unexperienced with CGI.



Let me know in case you need further details.

Thanks in advance...


Jean Spector
SQA Engineer @ Exanet
jean.spector@softhome.net


There are only 10 types of people in the world -
Those who understand binary, and those who don't.


Paul
Enthusiast

Feb 12, 2002, 4:11 AM

Post #2 of 9 (1330 views)
Re: [Jean] Adding modules to cgi-bin [In reply to] Can't Post

Before you "use" the modules, try adding:

use lib '/path/to/cgi-bin';

...to the top of your script.


Jean
User


Feb 12, 2002, 4:30 AM

Post #3 of 9 (1327 views)
Re: [RedRum] Adding modules to cgi-bin [In reply to] Can't Post

Been there, done that ...

Thanks for the help - I found it in some earlier post after I've posted the original question here and tried it without success altogether :-( though I'm not sure whether my path was correct Blush - I mean the path was correct for my user (and I've also tried the relative path), but I'm not sure whether the path stays the same when the script is started by the web server (BTW the path looks like this: /html/cgi-bin/path/to/modules)

Any additional suggestions would be appreciated very much.


Jean Spector
SQA Engineer @ Exanet
jean.spector@softhome.net


There are only 10 types of people in the world -
Those who understand binary, and those who don't.


(This post was edited by Jean on Feb 12, 2002, 4:37 AM)


Paul
Enthusiast

Feb 12, 2002, 4:34 AM

Post #4 of 9 (1325 views)
Re: [Jean] Adding modules to cgi-bin [In reply to] Can't Post

You would be best checking your error log. It normally gives lots of detail.


Jean
User


Feb 12, 2002, 4:40 AM

Post #5 of 9 (1322 views)
Re: [RedRum] Adding modules to cgi-bin [In reply to] Can't Post

Blush Sorry for not mentioning it in the first place, but currently I do not have access to the global error.log if such one exists :-) and the error.log that is located under logs directory that is accessible by my use is empty at all times :-(


Jean Spector
SQA Engineer @ Exanet
jean.spector@softhome.net


There are only 10 types of people in the world -
Those who understand binary, and those who don't.


fashimpaur
User / Moderator

Feb 12, 2002, 9:25 AM

Post #6 of 9 (1315 views)
Re: [Jean] Adding modules to cgi-bin [In reply to] Can't Post

There is a local Perl directory that your server looks to for modules when
a cgi-bin script is to be run. This directory is a sub-directory of the Perl
directory on Win32. In Unix it is a little harder to find. More than likely
you will need to go to CPAN and get most modules and install them using
the make command since some have C-code embedded that requires compiling
on your specific platform. If you are using Win32, you can get most modules
in zipped format and use ppm (perl package manager) which comes with
ActivePerl from ActiveState.com to install the modules. Others require
compiling if ActiveState does not have them.

Putting copies of modules in your cgi-bin is not recommended. Ask your
server admin to install modules required if you do not have privilege to do so.
It is inconvenient but necessary at times.

Good Luck,

Dennis

$a="c323745335d3221214b364d545".
"a362532582521254c3640504c3729".
"2f493759214b3635554c3040606a0",
print unpack"u*",pack "h*",$a,"\n\n";


Paul
Enthusiast

Feb 12, 2002, 10:17 AM

Post #7 of 9 (1314 views)
Re: [fashimpaur] Adding modules to cgi-bin [In reply to] Can't Post

use lib ''; adds the specified directory into @INC so it does the same job.

>>Putting copies of modules in your cgi-bin is not recommended.<<

There is no real problem in installing modules locally although installing them into the perl lib tree is recommended if possible, however nothing needs compiling on Windows so it shouldn't be a problem.


Jean
User


Feb 12, 2002, 11:46 PM

Post #8 of 9 (1309 views)
Re: [RedRum] Adding modules to cgi-bin [In reply to] Can't Post

  
After a certain exertion I conviced support to enable the error.log for a while.

That's what I'm getting:


Quote


Can't locate URI/URL.pm in @INC (@INC contains: /html/cgi-bin/Modules /usr/local/lib/perl5/5.6.0/sun4-solaris /usr/local/lib/perl5/5.6.0 /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl .) at (eval 1) line 3.



I'm not using the URI::URL.pm directly - it must be one of the following three:

LWP
HTTP::Request
XML::Parser


The modules I've copied to the server are located under the /html/cgi-bin/Modules (the first directory in the @INC)

The path is correct (the letter case is also correct - Unix)

Please note that I do not have shell access to the server and I've done something that shouldn't be usually done (expecting at least a change in error message) - I've copied the modules from my Win2K Perl to the Unix server. I would guess the problem is there, but the message still states "Can't locate" ...


Jean Spector
SQA Engineer @ Exanet
jean.spector@softhome.net


There are only 10 types of people in the world -
Those who understand binary, and those who don't.


(This post was edited by Jean on Feb 12, 2002, 11:59 PM)


Jean
User


Feb 13, 2002, 2:40 AM

Post #9 of 9 (1305 views)
Re: [Jean] Adding modules to cgi-bin [In reply to] Can't Post

Most of this thread has been a combination of my lack of experience and ineffective tech support.

Although I've explicitely asked support what was the FULL path to my directory on their server they gave me only part of it and I didn't think to check their word (stupid me).

Almost everything works for me now except one thing and I will open a new therad because the question is not (or just barely) related to the current topic.



My thanks to all who've tried to help


Jean Spector
SQA Engineer @ Exanet
jean.spector@softhome.net


There are only 10 types of people in the world -
Those who understand binary, and those who don't.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives