?
Solved

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

Posted on 2001-06-08
6
Medium Priority
?
191 Views
Last Modified: 2010-03-05
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;
0
Comment
Question by:dglenp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 8

Expert Comment

by:bebonham
ID: 6168763
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
 
LVL 3

Author Comment

by:dglenp
ID: 6168851
Thanks for the tip, but it didn't work. Good try, though.
0
 
LVL 8

Accepted Solution

by:
bebonham earned 800 total points
ID: 6169057
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Expert Comment

by:bebonham
ID: 6169058
if it does work, the problem is clearly your script.
0
 
LVL 3

Author Comment

by:dglenp
ID: 6169266
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
 
LVL 8

Expert Comment

by:bebonham
ID: 6169531
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question