CGI - 404 Error

Status
Not open for further replies.

hiholam

New Member
Messages
7
Reaction score
0
Points
0
I know there are many people having the same problem, but I tried to solve the problem by following the instrustions that are given in the forum and I still can't get it works.

I'm just trying to run a really simple cgi script, i.e print a line script.

#!/usr/bin/perl
print "Content-type: text/html\n\n";
print <<END_HTML;
<html>
<head></head>
<body>Hello, World!</body>
</html>
END_HTML

and I keep getting a 404 error. I did put #!usr/bin/perl on my first line of code, I set the premission to 755.

If anyone can help I am really appreciate it. Thank You!
 

hiholam

New Member
Messages
7
Reaction score
0
Points
0
Hi Corey

Thank you for your help, but now I get a 500 Error...
What should I do for that?
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
500 Error is from permissions, change the permissions on the file to 755.
 

hiholam

New Member
Messages
7
Reaction score
0
Points
0
I did change all permissions to 755, but still getting this error message:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@hiholam.x10hosting.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Do I have to do anything to .htaccess?
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Can you link to the script? I might have to take a look in the morning, getting late here.

-Corey
 

hiholam

New Member
Messages
7
Reaction score
0
Points
0
Hi,
I tried to download your script and I just renamed the file and upload it again by using file manager. So, the code should have no prolbem, but the 500 error is there if i run my script and it works fine for yours.
http://hiholam.x10hosting.com/cgi-bin/test.cgi

do you have any idea why is it? thanks
 

WoWChat

New Member
Messages
62
Reaction score
0
Points
0
ROFL! Sorry you're having this problem, i'm not laughing at that. I am laughing because that "Hello, World!" is the same text that is run in the world of warcraft mod creation tutorial by blizzard. Now, that is coincidental. :) haha.
 

QuwenQ

Member
Messages
960
Reaction score
0
Points
16
ROFL! Sorry you're having this problem, i'm not laughing at that. I am laughing because that "Hello, World!" is the same text that is run in the world of warcraft mod creation tutorial by blizzard. Now, that is coincidental. :) haha.


..."Hello, World!" is run by EVERYTHING as a test script. It's a silent vow in the coding world:
Thou shalt nought maketh a script without using a greeting to thou world.
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
..."Hello, World!" is run by EVERYTHING as a test script. It's a silent vow in the coding world:
Thou shalt nought maketh a script without using a greeting to thou world.
Quoted For Truth.

Basic:

10 PRINT HELLO,
20 PRINT WORLD
30 GOTO 10

C#
Console.WriteLine("Hello world!"); //I think, WriteLine might need a lowercase l, been a while since I've used it

Windows
An error has occured in Hello_World.exe, and the program must be shut down ;)


The idea is, generally speaking, printing Hello world! to the screen isn't resource intensive or anything weird like that. That makes it ideal for tests to see if something is installed or otherwise working properly - its not going to send 1000 files to the printer for printing, its not going to send 10,000 emails to Corey's inbox, it's simply going to say Hello World, to let you know it worked :)


As for the CGI error, no idea. The last time I got that error on my site was a .htaccess typo though (I don't use CGI though, I just use PHP/HTML); make sure any .htaccess files ARE working appropriately, cause if those are messed up you'll never get to the file to try and run it :tear:
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
You had an extra line in yours at the bottom I removed, it seems to work now.
 
Status
Not open for further replies.
Top