CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
spawning perl script from web page

 



perl_man
Novice

Aug 4, 2016, 4:42 PM

Post #1 of 2 (1400 views)
spawning perl script from web page Can't Post

hi
I'm having trouble executing a perl script on a remote server from a web page

here's the code inside the f0.cgi script

<<<<
#!/usr/bin/perl
use warnings;
use strict;
use diagnostics;
use CGI;

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

print <<EOF;
<html>
<head><title>Title</title></head>
<body>
EOF

my $out = `ls`;
print "<pre>$out</pre>";

print <<EOF;
</body>
</html>
EOF
exit;
>>>>

when clicking on the link I get the content of the script;not the directory listing as it is supposed to do
with the `ls` backtick command.

I'v chmod u+x f0.cgi
and chmod o+x f0.cgi

dir directory containing f0.cgi is also chmod

where did I go wrong ?
Frown


Zhris
Enthusiast

Aug 5, 2016, 8:15 AM

Post #2 of 2 (1387 views)
Re: [perl_man] spawning perl script from web page [In reply to] Can't Post

Is your server configured properly to permit CGI?

http://httpd.apache.org/docs/current/howto/cgi.html

Chris


(This post was edited by Zhris on Aug 5, 2016, 8:16 AM)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives