Problem moving Perl script from PWS 4.0 to Unix web server running Apache

I have written and tested two scripts on my NT 4.0 Workstation machine using Personal Web Server 4.0. I used Perl 5.005_03 from ActiveState for the Win32 platform to test the scripts. The web server runs Perl 5.005_02 and Apache 1.3.6. I have tried to avoid any obvious incompatibilities, but when I move the script to the Unix machine, I get an Internal Server Error. I believe I have taken care of the basics, i.e. file paths, etc. Any thoughts as to why the error occurs?

The script is below; it is a simple script for test purposes. Again, it runs fine on my test machine, but will not run on the Unix machine. Any obvious problems, or is it likely a configuration problem with the Unix server?

Thanks for your help...
 
#!/usr/local/safe/bin/perl
#######################################################
#
# Name: confirm.pl
#
#######################################################

use CGI;
use strict;

###################
# Constants
###################
use vars qw($CART_PATH $LOG_PATH);
use vars qw($MERCHANT);
use vars qw($URL);
use vars qw($SECRET);

###################
# Parameters
###################
use vars qw($response);
use vars qw($authcode);
use vars qw($message);
use vars qw($batch);
use vars qw($ticket);
use vars qw($queue);

###################
# Initialize
###################

$LOG_PATH = '/export/home/mission/public_html/cgi-bin/log';
$CART_PATH = '/export/home/mission/public_html/cgi-bin/cart';

    BEGIN {

        use CGI::Carp qw(carpout);

        # Send warnings and die messages to the browser.
        #
        carpout(STDOUT);

    }

###################
# Main script body
###################

$queue = new CGI;
print $queue->header('text/html');
print $queue->start_html('FAPS Demo Script');
print "<table><caption>This script received the following input:</caption>\n";

# Process input from the form
foreach my $n ($queue->param) {
    my $v = $queue->param($n);
    print "<tr><td>$n</td><td>$v</td></tr>\n";
    if ($n eq 'Response') {
        $response = $v;
    }
    elsif ($n eq 'AuthCode') {
          $authcode = $v;
    }
    elsif ($n eq 'Message') {
          $message = $v;
    }
    elsif ($n eq 'Batch') {
          $batch = $v;
    }
    elsif ($n eq 'Ticket') {
          $ticket = $v;
    }
}
print "</table>\n";
print $queue->end_html;
LVL 3
dglenpAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
bebonhamConnect With a Mentor Commented:
can you run a hello world script?

#!/usr/local/safe/bin/perl


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

print "HELLO WORLD";





try that...

if that doesn't work it is either the permissions
(you need to do chmod +x scriptname.pl)

or the server is misconfigured or perl is misconfigured.

Bob
0
 
bebonhamCommented:
do you have Carp on the unix system..

mine doesn't have fatalsToBrowser or carpout modules installed...

that's mostlikely the problem...

take out the parts about carp and see if it runs...

Bob

otherwise are you sure you set the permissions correctly?

0
 
dglenpAuthor Commented:
Thanks for the tip, but it didn't work. Good try, though.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
bebonhamCommented:
if it does work, the problem is clearly your script.
0
 
dglenpAuthor Commented:
Hi, Bob.

Thanks for the suggestion. I have been so focused on the script I'm writing, I didn't think to try the simple hello script. It's not the first bonehead thing I've done.

The 'hello world' script will not run. I have checked the permissions and double checked.

Thanks for the help.
0
 
bebonhamCommented:
yeah! (well, not 'yeah' for you) but yeah! at least we figured it out!

good luck,
sorry I am not really strong on Linux/Apache side, or else I'd try to help!

Bob
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.