Questions tagged [cgi]

1) The Common Gateway Interface is a standard defining how web server software can delegate web page generation to a stand-alone application or executable file. 2) Computer Generated Imagery

This tag is mostly used for the Common Gateway Interface (CGI), which is a standard (see RFC 3875: CGI Version 1.1) that defines how web server software can delegate the generation of web pages to a stand-alone application, an executable file. Such applications are known as CGI scripts; they can be written in any programming language, although scripting languages are often used.

Less commonly on Stack Overflow, CGI may also be used to tag questions regarding Computer Generated Imagery.

See also

5191 questions
10
votes
2 answers

Deploying a Flask application with CGI

I have written a small application using the Flask framework. I try to host this using cgi. Following the documentation I created a .cgi file with the following content: #!/usr/bin/python from wsgiref.handlers import CGIHandler from yourapplication…
monostop
  • 569
  • 1
  • 6
  • 17
10
votes
6 answers

How can close and reopen STDOUT in Perl?

I'd like to close STDOUT to prevent my code from outputing a particular image that I need for further computation but do not want on my web page. So i want to close STDOUT, do what I have to do with my code, then reopen STDOUT to output stuff to a…
Italics
  • 103
  • 1
  • 1
  • 6
10
votes
4 answers

How can I tell if a Perl script is executing in CGI context?

I have a Perl script that will be run from the command line and as CGI. From within the Perl script, how can I tell how its being run?
ryeguy
  • 65,519
  • 58
  • 198
  • 260
10
votes
1 answer

How to integrate multiple IP cameras into Android programmatically?

I am new in android networking. Now I am doing an Android network related project. In this project I want to integrate 6 IP cameras into my project and all cameras stream simultaneously. This IP cameras are Wi-Fi enabled cameras. The problem is…
Astro
  • 201
  • 1
  • 12
10
votes
3 answers

Why can't python find some modules when I'm running CGI scripts from the web?

I have no idea what could be the problem here: I have some modules from Biopython which I can import easily when using the interactive prompt or executing python scripts via the command-line. The problem is, when I try and import the same biopython…
Dave
  • 2,396
  • 2
  • 22
  • 25
10
votes
3 answers

How can I run Perl scripts using FastCGI on Nginx?

So I am following this guide: http://technotes.1000lines.net/?p=23 and I am going through the steps. I have a VPN (slicehost.com) with Debian Etch, serving a website (static so far) with nginx. I used wget to download FastCGI and I did the usual…
rey
  • 155
  • 1
  • 1
  • 8
10
votes
6 answers

What's the best way to write a Perl CGI application?

Every example I've seen of CGI/Perl basically a bunch of print statements containing HTML, and this doesn't seem like the best way to write a CGI app. Is there a better way to do this? Thanks. EDIT: I've decided to use CGI::Application and…
ristonj
  • 1,590
  • 1
  • 12
  • 15
10
votes
9 answers

Apache CGI in user directory "End of script output before headers"

I know there are some questions about this topic, but none seems to solve my issue. See this or this or this. I'm on Linux, Fedora21, and I'm trying to enable per user directory CGI script. I followed these instructions, but without success. I get…
AkiRoss
  • 11,745
  • 6
  • 59
  • 86
10
votes
2 answers

POST data to CGI file using XMLHttpRequest causes BadHeader

When I try posting data to my CGI file, my CGI file says the actual post data is invalid. I am using HTML/JavaScript for the front end and Python for the backend. Works:
kamran619
  • 531
  • 10
  • 32
10
votes
1 answer

Output binary data from CGI in Python 3

This question is related to this one. I was having no problems while printing raw binary data from a CGI script in Python 2, for example: #!/usr/bin/env python2 import os if __name__ == '__main__': with open(os.path.abspath('test.png'), 'rb')…
astrojuanlu
  • 6,744
  • 8
  • 45
  • 105
10
votes
2 answers

How to get a python script to listen for inputs from another script

I have a situation where I need one python script to be running in a continuous loop, and I need to pass parameters into it from another script which will run when an action occurs. The second script will be triggered by a website using cgi, I have…
Ger
  • 754
  • 1
  • 9
  • 33
10
votes
3 answers

Deploy flask application on 1&1 shared hosting (with CGI)

I've written a web application for my sports club with the flask web framework. I did everything on my local machine with the build-in test server. Know they told me to deploy it on an 1&1 shared hosting web space. They have python support but it…
Sebastian Bechtel
  • 363
  • 1
  • 3
  • 12
10
votes
2 answers

Environment variables are not passed from .htaccess to PHP

I am trying to pass an environment variable from .htaccess through to PHP. This works just fine on my local WAMP server, but on the server where my website is hosted, it fails without reason. Here's my test configuration: .htaccess: SetEnv…
nitwit
  • 1,745
  • 2
  • 17
  • 20
10
votes
8 answers

internal server error (500) in simple cgi script

I am trying to run a simple cgi script after configuring my server. My script looks like this: print "Content-type: text/html" print print "CGI" print "" print "hello cgi" print "" print "" When…
flybywire
  • 261,858
  • 191
  • 397
  • 503
10
votes
6 answers

How can I improve Moose performance in non-persistent CGI processes?

Moose is a fantastic object framework. The trouble is that, taken together with its dependencies, it's very big. Our profiling indicates that on our platform, simply loading Moose will incur a 5-6 second overhead on non-persistent CGI application…
Adam Bellaire
  • 108,003
  • 19
  • 148
  • 163