Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 25199  / 1 Year ago, sat, may 27, 2023, 2:24:43

I have a test script, /var/www/etym/cgi-bin/test.py



#!/usr/bin/python 
# -*- coding: UTF-8 -*-

# enable debugging
import cgitb
cgitb.enable()

print "Content-Type: text/plain;charset=utf-8"

print "Hello World!"


And I'm trying to run it by going to http://localhost/etym/cgi-bin/test.py in my browser, but it's not working--Firefox just asks me whether I'd like to open the file with gedit or save it to the disk. What do I need to do to get it to run? I already ran chmod +x on the script.


More From » python

 Answers
1

Make sure you have configured your webserver properly to run CGI scripts.



Refer this for more info: https://httpd.apache.org/docs/2.4/howto/cgi.html


[#29760] Saturday, May 27, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
adedes

Total Points: 454
Total Questions: 114
Total Answers: 111

Location: Turks and Caicos Islands
Member since Fri, May 8, 2020
4 Years ago
;