I can't run perl script in browser on ubuntu

This is my program

Example.html
<html>
<body>
<form action="/cgi-bin/time.pl">
<input type="submit"/>
</form>
</body>
</html>
And my perl script "time.pl"
#!/usr/bin/perl
print "content-type:text/plain\n";
use CGI': standard';
($sec,$min,$hr)=localtime(time);
print "$hr:$min:$sec";

Open in new window


If i run example.html in server it shows file not found
Priyanka RAsked:
Who is Participating?
 
David FavorConnect With a Mentor Linux/LXD/WordPress/Hosting SavantCommented:
First verify you can visit https://foo.com/time.pl to ensure your script executes outside an HTML page.

Refer to your /var/log/apache2/error.log or equivalent to debug.

Likely your ScriptAlias for CGI scripts requires some slight fix, which will show up clearly in error.log when you visit your script.
1
 
Henry LawCommented:
Wonder if the OP has fixed the problem?  If I understand EE's message display David commented (with good advice) nearly a week ago.
0
 
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Accepting my answer.

Poster has stopped posting.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.