cgi

Php exec python script 'weakness'/downside

岁酱吖の 提交于 2019-12-13 04:51:56
问题 What are the bad points when you execute a python script with php? Also, how is it different from executing python through the cgi method I found an this interesting method from Running python script from php and i thought it will be great to just use the exec("python ../cgi-bin/form.py"); and closely-related methods. Please explain properly and tell me what we have to keep in mind when using this method. 回答1: You problem is very common - and in general it's not about executing python scripts

jQuery elements not getting passed to perl cgi

笑着哭i 提交于 2019-12-13 04:36:04
问题 I have a html pg which has got two forms and upon submit its calling a perl script. But in the script cgi param is not getting any values. Html code -- <fieldset class="col_4" name="BetweenRange"> <legend>Range Comparison</legend> <form action="call_range.pl" method="post" id="range1" target="Range1"> <table width="100%" border="1"> <tr> <td><input name="r1_1stdate" type="text" id="from1" required/><input name="r1_2nddate" type="text" id="to1" required/></td> </form> <form action="call_range

CGI from Apache, broken pipe

半腔热情 提交于 2019-12-13 04:28:07
问题 What does happen with Apache (or Nginx) running a CGI script when the client (I mean a browser or a TCP gateway) disconnects in the middle? Does Apache/Nginx log an error? (If yes, which one and where?) Is the CGI script sent SIGPIPE to? 回答1: There is no SIGPIPE when Apache CGI script is interrupted. Tested with the following code: #!/usr/bin/perl use strict; use warnings; $| = 1; #$SIG{PIPE} = "IGNORE"; $SIG{PIPE} = sub { open my $f, '>', 'log.txt'; print $f "PIPE: $ENV{SERVER_NAME}\n";

Dynamically populate drop down menu with selection from previous drop down menu

自闭症网瘾萝莉.ら 提交于 2019-12-13 04:24:06
问题 I have a cgi script written in Python. There are two drop down menus and then a submit button. I'd like to be able to make a selection from the first menu, and based off that choice, have the second drop down menu dynamically populate new choices. The second menu should populate without having to click any button, but simply from making a selection from the first menu. The second menu should also repopulate continually every time I select a new item on the first menu - again, without clicking

How to run test perl script as cgi script with httpd?

。_饼干妹妹 提交于 2019-12-13 04:16:10
问题 I'm trying to follow this tutorial and run sample script under cgi. Below are steps which I did: 1) Made sample script $ cat > test.pl <<EOF > #!/usr/bin/perl > print "Content-type: text/html\n\n"; > print "Hello, World."; EOF 2) run httpd docker container and mounted created script as volume in cgi-bin directory: $ docker run --name cgi_test --rm -p 3000:80 -v $(pwd)/test.pl:/usr/local/apache2/cgi-bin/test.pl httpd 3) check if CGI module is enabled: $ docker exec -it cgi_test cat /usr/local

Apache - No matching DirectoryIndex - Path is changing to public_html

爱⌒轻易说出口 提交于 2019-12-13 03:03:00
问题 Im trying to run Flask on CGI, i added this to the .httaccess file: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /home/trafficzon/py.trafficzone.online/cgi-bin/flask.cgi/$1 [L] but when i make a request on http://py.trafficzone.online/ i get an 500 error, saying: Cannot serve directory /home/trafficzon/public_html/: No matching DirectoryIndex why does it redirected to public_html instead of the path in the .httaccess? 来源: https://stackoverflow.com/questions/55715990

mod_xsendfile won't work with CGI and mod_rewrite

瘦欲@ 提交于 2019-12-13 02:40:44
问题 I am trying to use the apache module xsendfile to get a better performance during file streaming. The problem is, that it is just working if I DO NOT use PHP as CGI Version AND if I DO NOT USE rewrite rules for my urls. Problem 1: mod_rewrite Calling this one in the Browser will work: http://subdomain.domain.de/image.php This one will give me a 404: http://subdomain.domain.de/rewrittenImageUrl The rewrite rules are working right. The 404 error is triggered by the xsendfile module. If I add a

Get form data using python

∥☆過路亽.° 提交于 2019-12-13 00:46:34
问题 How do i get form data in my Python code. Below is my current code. import cgitb; cgitb.enable() import cgi import sys form = cgi.FieldStorage() name = form.getValue('name') print 'Hello ' + name 回答1: You were close: form = cgi.FieldStorage() name = form['name'].value print 'Hello ' + name 来源: https://stackoverflow.com/questions/8891245/get-form-data-using-python

Is it possible to print from a perl CGI before the process exits?

我怕爱的太早我们不能终老 提交于 2019-12-13 00:34:32
问题 I have a perl CGI that needs to report some information back to the browser before it goes into a really lengthy process that frequently takes several minutes. Currently I print the message but it doesn't show up till the entire process exits. So, my question is: Is it possible to get the message back to browser mid stream and if not how do I spawn off a separate process to handle the lengthy bit, so that I can exit out of the initial process and thus have the user get the feedback they need.

How do I install php-cgi? I tried MacPort, Package and everything else but none works

旧巷老猫 提交于 2019-12-12 19:17:46
问题 I am trying to install php-cgi on my macbook (Yosemite 10.9.3) because the PhpStorm IDE keeps coming back to me "php-cgi not found" when i try to open things in browser. I tried to use a newer version of php interpreter because the current version is 5.4. But I can only find the packages in the php.net site but I have no clue how to install it. I also tried to download homebrew but again have no clue how to start there. I tried to use MacPort to install a fastcgi by using this line: sudo port