perl 500 Internal Server Error

Status
Not open for further replies.

x4d1_

New Member
Messages
8
Reaction score
0
Points
0
hi,
i am trying to do anything in perl... i have made a file which is here:
Code:
     #!/usr/bin/perl
     print "Content-type: text/plain\n\n";
     print "simple text";
i have put it in /public_html/cgi-bin and named it as perl.pl;
if i execute http://www.x4d1.x10hosting.com/cgi-bin/perl.pl there is an error:
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@x4d1.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.
after that i can see error entry:
File does not exist: /home/x4d1/public_html/500.shtml in error log in my cpanel
there are some screens:
screenshot143wa1.jpg
 

kajasweb

New Member
Messages
1,723
Reaction score
0
Points
0
I don't know Perl. But, I think I'm right...

Use the following code
Code:
     #!/usr/bin/perl
     print "Content-type: text/plain\r\n";
     print "simple text";
 
Last edited:

nahsorhseda

Member
Messages
116
Reaction score
0
Points
16
even i get the same error thats the reason i never used perl/cgi with my hosting acc. ,i only use php its much simpler
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
Have you set the chkmod permission to the perl file ?

They should be 755 !

Also you can change the hashbang to #!/usr/bin/perl -wT
(note the "T" will only work online)
 
Last edited:

nahsorhseda

Member
Messages
116
Reaction score
0
Points
16
its the same thing it still gives me the same error

Code:
/hsedan/public_html/500.shtml, referer: http://epics.us.to:2082/frontend/x3/files/selfile.html?dir=%2fhome%2fhsedan%2fpublic_html%2fcgi-bin&file=testdel.pl
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
uhm... okay try this, it should list all the modules installed :

Code:
#!/usr/bin/perl -wT
use english;
use strict;
use diagnostics;
use CGI qw/:standard/;
use ExtUtils::Installed;

my $inst    = ExtUtils::Installed->new();
my @modules = $inst->modules();

&print_html;
sub print_html { 
print "Content-type: text/html\n\n";
print <<ENDHTML;
<HTML>
<HEAD>
<TITLE>Perl Module Test</TITLE>
</HEAD>
<BODY>
These are all the modules installed on this server!\n
ENDHTML
foreach (@modules) {
print "$_\n";
print "<P>\n";}
print <<ENDHTML
END
</BODY>
</HTML>

ENDHTML
}
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
If you have set the permissions on the file to 755, then it should at least print a warning.
Give me a link to the file.

There also might be something wrong with the settings of the cgi-bin.
 

mr kennedy

Member
Messages
524
Reaction score
1
Points
18
Even in PHP, you'll really get the same error so here's what you need to do:

Download your script
Delete that folder you downloaded the script from...
Recreate that folder(ChMod to 755)
Upload that script to that folder

hope that helps...
 

max1x

New Member
Messages
27
Reaction score
0
Points
0
I tried several way, but am unable to make cgi or pl scripts work (permission were set 755 in all instances). As stated above I deleted the cgi-bin complete (the free scripts that are provided by cPanel get installed here correctly, but don't execute either).

#!/usr/bin/perl

use CGI;
print "Content-type:text/html\n\n";
print "Hello World";

#!/usr/bin/perl

print "Hello World";
here is 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@msdn.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.
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
Ok, I am moving this to 2nd level support in the free hosting section. A administrator will take a look and see what the problem is.
 

max1x

New Member
Messages
27
Reaction score
0
Points
0
I finally got every thing working last night. I have installed all my cgi scripts in cgi-bin, even some external tools...modifed some of them with the -w switch and chmod to 755, and viola most of them are now up and running. It seems that the entry page (first page that's rendered), requires a -w, while other don't (in most cases). Also look at the errors in the errorLog from cPanel or the error file created with in the cgi-bin dir.

Any one that did not work, I modifed with the -w switch and it started working. For those who are having troubles, start out with a simple script (with and w/o -w).

#!/usr/bin/perl -w

print "Hello World";
 
Status
Not open for further replies.
Top