M
M
Mortech2020-10-19 16:39:36
Perl
Mortech, 2020-10-19 16:39:36

How to run a simple cgi script on shared hosting?

The simplest script itself is under the spoiler. Error in logs: end of script before headers.
Created .htaccess with AddHandler cgi-script .cgi .pl .py
Options +ExecCGI using this path . Error 500
when switching to script test.ml/cgi-bin/cgi.pl

spoiler
/home/clients/mort_ftp0/domains/test.ml/html/cgi-bin/cgi.pl


spoiler
#!/usr/sbin/perl

use strict;
use warnings;

use CGI;

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

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GermanS, 2020-10-29
@GermanS

The error log will tell a lot more than the web server will answer why the 500 response is coming.
But it is possible that the script does not have execution rights.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question