PDA

View Full Version : CGI *NEVER* Worked


camaro92
01-19-2002, 10:19 PM
I've been hosted with Host Rocket for over a year now and i've *NEVER* been able to get a .cgi script to work. I ALWAYS get "error 500: Internal Error"

I've even installed .cgi scripts that require only 1 config change; the perl path. However the paths were always the same which is what host rocket uses.. #!usr/bin/perl

So this means there is absolutely nothing wrong with the scripts. There is no configuration error in the scripts..

What IS wrong is something on my server..

So my question is this:

Is ANYONE here experiencing the same? CGI does not work?

http://www.scriptsolutions.com/programs/free/perldiver/

This script simply displays all your perl environment variables. I would greatly appreciate it if you guys could attempt to install it on your host rocket server and see if it works on YOUR server. Does not work on mine (Host16).

Sent in trouble ticket MANY MANY MANY times thoughout the year and they have all been ignored. I sent in a trouble ticket for the cgi problem again today and as of now 5 hours later, no reply.

Stewart
01-19-2002, 10:43 PM
something cant b right, you can use http://www.camarosource.ca/cgi-sys/perldiver.cgi though. This is the shared perldiver script on all servers. I would say it could be something in .htaccess mucking .cgi stuff up, try renaming the script to .pl and see what happens. Also, you should really run cgi scripts from with the cgi-bin directory.

camaro92
01-19-2002, 11:08 PM
Originally posted by Stewart
something cant b right, you can use http://www.camarosource.ca/cgi-sys/perldiver.cgi though. This is the shared perldiver script on all servers. I would say it could be something in .htaccess mucking .cgi stuff up, try renaming the script to .pl and see what happens. Also, you should really run cgi scripts from with the cgi-bin directory.

Thanks for the reply.

I renamed it to .pl (perldiver.pl) but it still gives the same error. Also, I do run all the scripts I attempt to work from the cgi-bin directory :)

http://www.camarosource.ca/cgi-bin/perldiver.pl
http://www.camarosource.ca/cgi-bin/perldiver.cgi

One is .cgi, the other is renamed to .pl

Same file, different ext. same error..

camaro92
01-19-2002, 11:09 PM
Also, I don't have .htaccess

I have frontpage 2002 extensions on the server which prevents you from using a .htaccess file. So it's not the .htaccess :)

El_Nino
01-20-2002, 02:13 AM
Make sure the permissions on the cgi file is set to atleast 775

camaro92
01-20-2002, 02:26 AM
Originally posted by El_Nino
Make sure the permissions on the cgi file is set to atleast 775

Yep. All .cgi is set to 755 and i've even set them to 777 to ensure it's not a problem with permissions

Stewart
01-20-2002, 08:32 AM
Are you uploading the scripts in the right format? Something like CuteFTP will do this automatically. I think .pl and .cgi are uploaded in ASCII, but I'm not sure.

El_Nino
01-20-2002, 11:45 AM
Does your error log show anything when you try to run your scripts?

camaro92
01-20-2002, 03:54 PM
Originally posted by Stewart
Are you uploading the scripts in the right format? Something like CuteFTP will do this automatically. I think .pl and .cgi are uploaded in ASCII, but I'm not sure.

I use the Control Panel's File Manager to upload them because I have frontpage 2002 extensions and ftping cause them to corrupt.

camaro92
01-20-2002, 04:09 PM
Originally posted by El_Nino
Does your error log show anything when you try to run your scripts?

I get the same error for each and every cgi/pl ever installed. Even ones that don't require ANY configuring

[Sun Jan 20 15:06:19 2002] [error] [client 142.179.31.80] File does not exist: /home/camaro92/public_html/500.shtml
[Sun Jan 20 15:06:19 2002] [error] [client 142.179.31.80] Premature end of script headers: /home/camaro92/public_html/cgi-bin/perldiver.cgi
[Sun Jan 20 15:06:19 2002] [error] (2)No such file or directory: exec of /home/camaro92/public_html/cgi-bin/perldiver.cgi failed

I've had over 20 people try this particular script on their server (other hosts) and it works perfectly with no errors

freebiesforever
01-21-2002, 09:12 AM
try uploading it though cuteftp, to your cgi-bin and change the permissions to 777.

go to http://www.freebiesforever.com/cgi-bin/auction.pl

Any ideas why I get a error for opening the catagorys? perhaps the script doesn't working?

jason

http://www.freebiesforever.com

El_Nino
01-21-2002, 11:51 AM
I dunno, I tried a search on your auction page and it said:
http://www.freebiesforever.com/cgi-bin/auctiondata/category.file No such file or directory

Rob
01-21-2002, 12:14 PM
Those of you experiencing problems with running perl scripts on your sites, what hosts are you on?

freebiesforever
01-21-2002, 02:34 PM
I'm on host4,

My site has been down for nearly an hour, this is pissing me off!

Sorry for my attitude, but I have a customer service chat service from liveperson on my site and losing traffic and money.

Thanks,

Jason

http://www.freebiesforever.com

camaro92
01-21-2002, 09:31 PM
Originally posted by freebiesforever
try uploading it though cuteftp, to your cgi-bin and change the permissions to 777.

As mentioned above, when you have frontpage extensions (like me) you cannot use an ftp program as it corrupts the extensions. Also, the files were set to 777 to ensure it's not the permissions.. I have no idea what is wrong.

Host 16

jouni
01-31-2002, 09:35 PM
It's not how they were uploaded.

There is something wrong with the environment - my scripts from my old hosting provider stopped working here.

This bare-bones script, that has the right permissions, and is in
the right directory produces a 500 error:

#!/usr/bin/perl

print '<HTML><HEAD></HEAD><BODY>';
print '<H1>Hello World</H1>';
print '</BODY></HTML>';

I wish HostRocket would just admit they don't support CGI.
I think I'm going to change my stuff to PHP

El_Nino
02-01-2002, 12:56 AM
Have you submitted a troubleticket with examples?

me231
02-02-2002, 03:16 PM
I just signed up. I only need to get 2 basic cgi scripts working for my site... hopefully i won't have to be hear voicing my frustrations...

cdz
02-14-2002, 02:20 PM
Hey guys, please don't panic... every linux server in the world can run perl scripts... The only way to find out what's actually wrong is to try to run them through an SSH/Telnet session. Then you can really see what the error is...

my 0.02$

gds
02-22-2002, 12:34 PM
I cant get perl scripts to run here. My 4 cents!

cdz
02-22-2002, 01:27 PM
A little tip for those not comfortable with runing their scripts through an SSH session (to have better details on errors than the frustrating 500 browser error), is to put this line at the begining of the script:

use CGI::Carp 'fatalsToBrowser';

This will spit details about the error into the browser. Often, when you transfer from one provider to another, the other one had some perl modules not installed on the new one. Also, another thing to watch for is that the file should be saved in "unix" format, and not in "dos" format. The CR/LN sequence are different between the 2.

El_Nino
02-22-2002, 04:42 PM
Originally posted by jouni
#!/usr/bin/perl

print '<HTML><HEAD></HEAD><BODY>';
print '<H1>Hello World</H1>';
print '</BODY></HTML>';
I tried that exact code and it didn't work because of "malformed header" which is what should show up in your Error Log. This code below, however, should work:
#!/usr/bin/perl
print "Content-type: text/html\r\n\r\n";
print '<HTML><HEAD></HEAD><BODY>';
print '<H1>Hello World</H1>';
print '</BODY></HTML>';
CHMOD it to 755 and see if it runs.

gds
02-22-2002, 06:12 PM
I tried what you surgested putting in the top of the file and I still get the 500 error. How do you make the file for unix? Thank you

El_Nino
02-22-2002, 06:26 PM
If you used just the code I posted, it should work. What shows up in your error log? If you CHMOD'd it to 755 it should beable to execute.

gds
02-22-2002, 06:29 PM
In the error log I get a simular log like running ikonboard.cgi. I dont think I have perl installed. :(

El_Nino
02-22-2002, 06:31 PM
Like I said in the other thread, using IE to upload to FTP is probably what is causing all these problems. Download CuteFTP, SmartFTP or WS_FTP and then reupload everything and you should be fine.

cdz
02-22-2002, 11:32 PM
Originally posted by gds
I tried what you surgested putting in the top of the file and I still get the 500 error. How do you make the file for unix? Thank you

If you're refering to the "use CGI::Carp 'fatalsToBrowser';" line, you will still get the 500 error, but with more details.

For a simple yet free text editor that will give you the ability to save your files in unix format, you can take a look at "Notetab light" from http://www.notetab.com .