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
1
vote
0 answers

Can't run CGI script

I have a problem with my CGI script. Here is what I do with my script : create test.cgi in /usr/lib/cgi-bin > chmod -x test.cgi> ./test.cgi It return an Internal Server error, like I detetect that my system doesn't see where I created this script,…
Thanh
  • 11
  • 2
1
vote
2 answers

500 Server Error With Running Flask App With CGI Script

I keep receiving a 500 Internal Server Error with my Python Flask/CGI program. I am running it on shared hosting, so I followed this…
user14210589
1
vote
3 answers

perl cgi script can't post to site - works standalone but fails when running under apache

I have written a Perl CGI script which fetches an html page from a site using POST, then does some processing on the html data and prints output html content. My script url: http://mysite.com/cgi-bin/p.pl Site URL:…
Girish
  • 925
  • 3
  • 10
  • 20
1
vote
1 answer

Using CGI - python having problem finding modules

I am trying to run a python-script via CGI but I get Internal server error error log according to apache2: [Mon Dec 21 10:43:19.073771 2020] [cgi:error] [pid 7531] [client ::1:50038] AH01215: File "/usr/lib/cgi-bin/pytest.py", line 5, in…
java
  • 1,165
  • 1
  • 25
  • 50
1
vote
1 answer

500 internal Server error when configuring python cgi

I have been trying to run a simple python script hello.py with CGI but am getting 500 Internal Server Error. My python code. #!/usr/bin/python2.7 print '' print '' print 'Hello World - First CGI Program' print…
1
vote
1 answer

Perl alternatives for asynchronous script execution when forking is disallowed and backticks and system() do not work?

Update: This has been resolved for system() and backticks by specifying the full path to the external script. I will further investigate the fork issue on my own. Thanks to all for assisting. At How do I run a Perl script from within a Perl script?…
1
vote
1 answer

Read from uploaded XLSX file in Python CGI script using Pandas

I am creating a tool where either A new XLSX file is generated for the user to download The user can upload an XLSX file they have, I will read the contents of that file, aand use them to generate a new file for the user to download. I would like…
lhmarsden
  • 177
  • 11
1
vote
4 answers

How to display results out of a loop (Perl cgi)

I have a question! I have built a cgi file which is doing the following: a loop which querys a database while rows are found, build an image and print it Everything works fine. But now my Problem: if I find too many entries, I don't want to…
Ajin
  • 291
  • 3
  • 13
1
vote
2 answers

Accept parameters only from POST request in python

Is there a way to accept parameters only from POST request? If I use cgi.FieldStorage() from cgi module, it accepts parameters from both GET and POST request.
stdio
  • 435
  • 2
  • 7
  • 18
1
vote
2 answers

Managing cookies in Perl

I'm working on a Perl script that has to retrieve a file from a server. The server requires authentication that is handled internally by a different server. What I need to do to retrieve the file, is to first, POST to an authenticating server, which…
Lazloman
  • 1,289
  • 5
  • 25
  • 50
1
vote
1 answer

Safer way to use CGI text input param?

Okay, so there is an input form, with 4 text boxes. I get the input using CGI.pm: my $exc0 = param('exclude0') || 'a'; my $exc1 = param('exclude1') || 'a'; my $exc2 = param('exclude2') || 'a'; my $exc3 = param('exclude3') || 'a'; The reason I had…
Jon
  • 757
  • 5
  • 20
1
vote
1 answer

Count number of bits in a hex in perl

I have a variable in perl cgi, that stores a hex value. My requirement is to find if this variable contains an ipv4 address or an ipv6 address. And as per this, I need to call inet_ntop(AF_INET, $ip); #ipv4 Or inet_ntop(AF_INET6, $ip); #ipv6 The…
Athul Sukumaran
  • 360
  • 4
  • 16
1
vote
0 answers

How to make 'Content-type: text/html' not to be displayed in output?

I have a cgi python script which gets data from html form, handles it and makes a table which put to html code. The snip of the code: # -*- coding: utf-8 -*- import cgi print('Content-type: text/html\n') print() print(""" …
1
vote
1 answer

Perl CGI writing to a file concurrently

Lets say I have the following: #!/usr/bin/perl use strict; use warnings; use CGI ":standard"; ...Snippet... open (FH, '>', "file.txt") or die ("ERROR:$!"); print FH "something"; close(FH); As it it cgi on Apache, this cgi script could be called…
PaulM
  • 345
  • 2
  • 11
1
vote
0 answers

python http.server hangs when running cgi code in ubuntu

Sorry for the possible duplication of the question. I'm using python 3.7 http.server (python -m http.server --cgi 8080) to test the webserver locally, it works fine under Windows (and under Ubuntu on the server where nginx is running). But when I…
Alexander Korovin
  • 1,639
  • 1
  • 12
  • 19