Cgi

undead_corpse

New Member
Messages
11
Reaction score
0
Points
0
With my cgi script I get this error returned
script not found or unable to stat: /home/alkdude/public_html/remote/cgi-bin/test.cgi
this is the script:
#!/usr/local/bin/perl

# hello.pl -- my first perl script!

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

print <<"EOF";
<HTML>

<HEAD>
<TITLE>Hello, world!</TITLE>
</HEAD>

<BODY>
<H1>Hello, world!</H1>
</BODY>

</HTML>

What is my obvouis mistake? The CHMOD is set correctly (755) So I'm not sure what to do!
EOF
 

Russ

<b>Retired *****</b>
Messages
3,168
Reaction score
2
Points
38
I am going to move this to a more appropriate forum. I don't, and haven't done cgi in years. Just curious, why not php?
 

undead_corpse

New Member
Messages
11
Reaction score
0
Points
0
CGI is a bit easier for me to get started... I'll probably do half/half was the idea because I know perl better then PHP but yeah I'll try to use PHP for awhile put if people can help me out with CGI let me know ;)
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
Code:
#!/usr/local/bin/perl

# hello.pl -- my first perl script!

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

print <<"EOF";
<HTML>

<HEAD>
<TITLE>Hello, world!</TITLE>
</HEAD>

<BODY>
<H1>Hello, world!</H1>
</BODY>

</HTML>

should rather be :
Code:
#!/usr/local/bin/perl -wT
# -w is the same as use warnings;
# T this still escapes me, only works when I upload scripts

use english;
use strict; # makes sure all vars are declared
use diagnostics; # gives better warnings


# hello.pl -- my first perl script!

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

print <<END;

<TITLE>Hello, world!</TITLE>
</HEAD>

<BODY>
<H1>Hello, world!</H1>
</BODY>

</HTML>
END
exit;

Make sure the file is saved as a *.pl in the cgi-bin and chkmod is 755.
 
Last edited:
Top