Jump to content

[Answered] Perl Cgi - 500 Internal Server Error


Recommended Posts

Posted

Sorry, I really tried to find the solution in the forum:

I got a perl script in the cgi-bin folder of my public_html.

Permission is 0755 (so runable) in File Manager.

Shebang is #!/usr/bin/perl -w

But when i try "http://tarock.heliohost.org/cgi-bin/test.pl" I get the Internal Server Error. :-(

 

test.pl:

#!/usr/bin/perl -w

use strict;
use CGI;

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

Server: Stevie

User: tarock

Posted

This is usually permissions issues, but you already chmodded it to 755. Have you tried running it from another folder? Also, try it using #!/usr/local/bin/perl as the shebang line.

Posted

No you don't have to ask to have it chmoded. I didn't check the file permissions before I chmoded your file so I don't know what it was before. Just make sure you choose 755 on any cgi/perl files. If you have anymore problems, post back.

Posted

Well, I still have my file DBSelectStatement.pl which has the same permissions 0755, but I get the server error. I just copied this one and named it test.pl.

I can't figure out what is the difference between your 0755 and mine. Is there another possibility for me to do a chmod but in File Manager?

Posted

That's because you code in DBSelectStatement.pl is throwing a 500 error. Fix your code and it will work too.



More precisely, remove this line of code: use Cpanel::JSON::XS;

Posted

Thanks a lot. That helped.

I also figured out, that it takes some time, after changing the file permissions, till you can run the script. That irritated me.

Posted

I also figured out, that it takes some time, after changing the file permissions, till you can run the script. That irritated me.

That's probably just your cache. It should run immediately after you change the permissions.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...