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

Python CGI server extract request header

I am trying to run a python CGI server. The cgi-bin folder in server has the test.cgi file. I am sending a curl request to this server and am expecting the request header to be printed in the CGI. I saw several stackoverflow pages suggesting using…
user987743
  • 45
  • 1
  • 6
1
vote
2 answers

Flushing output buffer in C (cgi)

The following code: int z = 0; while(z < 4) { printf("iteration %d\n",z); sleep(1); z++; } Works fine and stdout buffer is flushed every second if running the program from command line. However, when I try to access the program in a web browser…
user562854
1
vote
1 answer

Placing a javascript code into a perl script

I am attempting to place some JavaScript into a Perl script (extension .pl). The JavaScript is for interactive social media buttons, however they don't appear on the page. Here is the code that I placed in the Perl script:
Netrunner21
  • 51
  • 2
  • 9
1
vote
1 answer

running utf8 encoded php script with fastcgi

I have installed Nginx and I used fastcgi to run php script. When I run php script encoded as "utf8" I have got an error about "header": FastCGI sent in stderr: "PHP Warning: Cannot modify header information - headers already sent by (output…
Darm
  • 5,581
  • 2
  • 20
  • 18
1
vote
1 answer

How to properly use Apache's mod_env module to modify PATH?

I have a bunch of python scripts that start with this shebang line: #!/usr/bin/env python3 When attempting to run the scripts at the command line, all works as expected. When using Apache, I get the "Internal Server Error" message. Inspecting the…
ajw170
  • 144
  • 1
  • 10
1
vote
1 answer

PERL CGI: Filehandle that uses both binary and text mode

I have a perl program that writes application/zip document with binary data. I can do the following code in my cgi script. print $cgi->header(-type=>"application/x-zip; name=\"$filename.zip\"", -content_disposition=> "attachment;…
Atey1
  • 251
  • 3
  • 10
1
vote
1 answer

408 Request Timeout, Apache

I cannot upload larger files. The application is Perl based runs on cgi. Log 1: public_html/cgi-bin/logs/upload.log [Thu May 28 14:09:04 2020][5436] [Thu May 28 14:09:04 2020] upload.cgi: CGI.pm: Server closed socket during multipart read (client…
1
vote
4 answers

.cgi problem with web server

The code #!/usr/bin/env python import MySQLdb print "Content-Type: text/html" print print "Books" print "" print "

Books

" print "
    " connection = MySQLdb.connect(user='me', passwd='letmein',…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
1
vote
2 answers

problem executing a python cgi script in apache webserver

I have searched and read other posts with similar problems. I fixed the shebang line in the .py file and made sure that httpd.conf has correct config. Unfortunately, nothing has resolved my problem and I still get the dreaded errors - [Mon Jun 01…
user2754571
  • 251
  • 3
  • 14
1
vote
2 answers

"Best" way to generate ~500 smallish images, either in JavaScript or server-side C

This is my very first attempt at generating images on the fly. I want to display around 500 small -- say, 32px X 24px -- 16-color images, each in a table cell. Each image (as I see it now) is a 2D array of colored pixels, each representing a value…
Pete Wilson
  • 8,610
  • 6
  • 39
  • 51
1
vote
1 answer

How to run this simple Perl CGI script on Mac from terminal?

This simple .pl script is supposed to grab all of the images in a directory and output an HTML — that when opened in a browser — displays all of the images in that dir at their natural dimensions. From the mac command line, I want to just say perl…
Rowe Morehouse
  • 4,451
  • 3
  • 28
  • 28
1
vote
1 answer

mod_cgi + utf8 + Python3 produces no output

If you create this app.py #!/usr/bin/python3 print("Content-Type: text/plain;charset=utf-8\n") print("Hello World!") and you enable CGI in .htaccess with: Options +ExecCGI AddHandler cgi-script .py it totally works: http://example.com/app.py…
Basj
  • 41,386
  • 99
  • 383
  • 673
1
vote
1 answer

perl code to read external file to a certain point, then read from that point on

I'm trying to open a file from a Perl script and search for "Quiz 2" (which is about 65 lines into the text file). Then, from that point until "============" is found (which is at the end of each 'Quiz'), push only the lines between those two points…
Nickalf
  • 13
  • 5
1
vote
2 answers

Check for the existence of empty parameters in CGI.pm

To check if a request parameter has a value (http://example.com?my_param=value) you can use query->param('my_param') This seems to be flaky if the no_value form is used: http://example.com?my_param . Is there a way to check simply the existence of…
serv-inc
  • 35,772
  • 9
  • 166
  • 188
1
vote
1 answer

AJAX: Passing a string through CGI that contains '&' character

I am creating a website updater. I am passing strings over CGI using AJAX. I have a problem where if my strings contain an '&' character they get incorrectly separated because CGI separates parameters/variables by a '&' character So if I send this: …
user593747
  • 1,484
  • 4
  • 32
  • 52
1 2 3
99
100