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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...