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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ssi script execution problem 1

Status
Not open for further replies.

arcnon

Programmer
Aug 12, 2003
242
US
I have a script that runs fine but when I try to call it with a <!--#include virtual="/cgi-bin/quote.cgi"--> it throws a process error. If I delete everything and do a print "test"; it works. I really am at a loss.

Any thougths?
 
it appears that using

use LWP::Simple;

causes the error. Is there a work around?
 
Some questiuons:

What does the scipt do?

Does it run when not being called as an SSI file?

Is it necessary to use the LWP module in the script?



There's always a better way. The fun is trying to find it!
 
What's the error?
--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
yes the script runs as standalone(commandline) or as a cgi and 2nd script I included works. But the first script with LWP::Simple throws the ominous error.

[an error occurred while processing this directive]

the server log of the error reports:

[Mon Aug 9 16:56:37 2004] [error] [client 192.168.1.1] unable to include "/cgi-bin/Data/Scifi.pl" in parsed file /Library/WebServer/Documents/index.shtml

the scripts that follow are the full scripts. I have rendered them down to the barest working/non-working state.
##### this script causes the above error
#!/usr/bin/perl -w

use strict;
use LWP::Simple;


print "Content-type: text/html\n\n";
print "test";

##### this one works fine
#!/usr/bin/perl -w

use strict;

print "Content-type: text/html\n\n";
print "test";

It appears that just using "use LWP::Simple;" throws the error. I am at a total loss as to what to try next.

additional info:
perl 5.8.1
os x jaguar
script permissions 777

I tested it with some of the other modules but I haven't found any others that throws an error as well.
 
First... is the LWP module installed?
Next, are you sure that SciFi.pl is in the sub-directory Data in the cgi-bin directory? Additionally, are the files on the server capitalized as you show them? Some implementations are case sensitive.

There's always a better way. The fun is trying to find it!
 
it runs from the command line or as a cgi script just fine.

as a ssi include the first script throws a error and the 2nd does not. so I know that the path stuff is correct if it will execute.
 
Then it must be that the LWP module is not loaded!

There's always a better way. The fun is trying to find it!
 
how can it run from the commandline and right out of the cgi-bin?
 
Both scripts will run from the command line even if LWP isn't loaded because neither script is using LWP. ALl you're doiing is tell the script to use it. Why not put in some code that utilizes LWP? If all you're doing is creating a web page you don't need LWP.

There's always a better way. The fun is trying to find it!
 
I did/do.... I kept cutting out the code until I got it to a point to where I know what is causing the error hence the 2 scripts the one that works and the one that doesn't. The point IS that as an include it is not executing the script while the script contains use LWP::Simple. The script will execute when it is not called from my .shtml page but as soon as I call it from the page it throws a error. The reason I know it is LWP:Simple is if I comment out the LWP::Simple it works and uncommented it won't work.

 
tviman I must apologize for thinking that you were off your rocker. It would appear that my LWP::Simple either was messed up or something I cpan reinstalled it and now it works as a include. I wish I knew why it worked as a script and not as a include!

thanks for you help guys
 
Computers... ya just gotta love em!

Anyway, glad you got it worked out.

There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top