cgi

什么是CGI、FastCGI、PHP-CGI、PHP-FPM、Spawn-FCGI?

岁酱吖の 提交于 2019-11-26 22:16:12
   什么是CGI   CGI全称是“公共网关接口”(Common Gateway Interface),HTTP服务器与你的或其它机器上的程序进行“交谈”的一种工具,其程序须运行在网络服务器上。   CGI可以用任何一种语言编写,只要这种语言具有标准输入、输出和环境变量。如php,perl,tcl等    什么是FastCGI   FastCGI像是一个常驻(long-live)型的CGI,它可以一直执行着,只要激活后,不会每次都要花费时间去fork一次(这是CGI最为人诟病的fork-and-execute 模式)。它还支持分布式的运算, 即 FastCGI 程序可以在网站服务器以外的主机上执行并且接受来自其它网站服务器来的请求。   FastCGI是语言无关的、可伸缩架构的CGI开放扩展,其主要行为是将CGI解释器进程保持在内存中并因此获得较高的性能。众所周知,CGI解释器的反复加载是CGI性能低下的主要原因,如果CGI解释器保持在内存中并接受FastCGI进程管理器调度,则可以提供良好的性能、伸缩性、Fail- Over特性等等。    FastCGI与CGI特点   1、如CGI,FastCGI也具有语言无关性.   2、如CGI, FastCGI在进程中的应用程序,独立于核心web服务器运行,提供了一个比API更安全的环境。

How can I send POST and GET data to a Perl CGI script via the command line?

こ雲淡風輕ζ 提交于 2019-11-26 19:45:21
问题 I am trying to send a get or a post through a command-line argument. That is test the script in the command line before I test through a browser (the server has issues). I tried searching online, and I suppose I was probably using incorrect terminology because I got nothing. I know this is possible because I saw someone do it. I just don't remember how it was done. Thanks! :) 回答1: Are you using the standard CGI module? For example, with the following program (notice -debug in the arguments to

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

夙愿已清 提交于 2019-11-26 18:14:10
问题 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 seems like they only allow CGI to run python scripts. I tried this tutorial: flask via CGI I ignored the rewrite stuff until now. All requests to my CGI script resulted in a 404 error. I modified my 404 handler in the application to return request

How Python web frameworks, WSGI and CGI fit together

无人久伴 提交于 2019-11-26 17:59:32
I have a Bluehost account where I can run Python scripts as CGI. I guess it's the simplest CGI, because to run I have to define the following in .htaccess : Options +ExecCGI AddType text/html py AddHandler cgi-script .py Now, whenever I look up web programming with Python, I hear a lot about WSGI and how most frameworks use it. But I just don't understand how it all fits together, especially when my web server is given (Apache running at a host's machine) and not something I can really play with (except defining .htaccess commands). How are WSGI , CGI, and the frameworks all connected? What do

How to get rid of non-ascii characters in ruby

旧街凉风 提交于 2019-11-26 17:56:56
问题 I have a Ruby CGI (not rails) that picks photos and captions from a web form. My users are very keen on using smart quotes and ligatures, they are pasting from other sources. My web app does not deal well with these non-ASCII characters, is there a quick Ruby string manipulation routine that can get rid of non-ASCII chars? 回答1: Use String#encode The official way to convert between string encodings as of Ruby 1.9 is to use String#encode. To simply remove non-ASCII characters, you could do this

How do I configure Apache 2 to run Perl CGI scripts?

早过忘川 提交于 2019-11-26 17:31:18
I would like to configure Apache 2 running on Kubuntu to execute Perl CGI scripts. I've tried some steps that I came across by googling, but nothing seems to work. What is the right way of achieving this? beck03076 This post is intended to rescue the people who are suffering from *not being able to properly setup Apache2 for Perl on Ubuntu. (The system configurations specific to your Linux machine will be mentioned within square brackets, like [this]). Possible outcome of an improperly setup Apache 2: Browser trying to download the .pl file instead of executing and giving out the result.

Redirect Standard Output Efficiently in .NET

倖福魔咒の 提交于 2019-11-26 16:45:20
问题 I am trying to call php-cgi.exe from a .NET program. I use RedirectStandardOutput to get the output back as a stream but the whole thing is very slow. Do you have any idea on how I can make that faster? Any other technique? Dim oCGI As ProcessStartInfo = New ProcessStartInfo() oCGI.WorkingDirectory = "C:\Program Files\Application\php" oCGI.FileName = "php-cgi.exe" oCGI.RedirectStandardOutput = True oCGI.RedirectStandardInput = True oCGI.UseShellExecute = False oCGI.CreateNoWindow = True Dim

lamp架构

独自空忆成欢 提交于 2019-11-26 14:14:53
1. lamp简介 所谓lamp,其实就是由Linux+Apache+Mysql/MariaDB+Php/Perl/Python的一组动态网站或者服务器的开源软件,除Linux外其它各部件本身都是各自独立的程序,但是因为经常被放在一起使用,拥有了越来越高的兼容度,共同组成了一个强大的Web应用程序平台。 LAMP指的是Linux(操作系统)、Apache(HTTP服务器)、MySQL(也指MariaDB,数据库软件)和PHP(有时也是指Perl或Python)的第一个字母,一般用来建立web应用平台。 2. web服务器工作流程 web服务器的资源分为两种,静态资源和动态资源 静态资源就是指静态内容,客户端从服务器获得的资源的表现形式与原文件相同。可以简单的理解为就是直接存储于文件系统中的资源 动态资源则通常是程序文件,需要在服务器执行之后,将执行的结果返回给客户端 2.1 cgi与fastcgi CGI(Common Gateway Interface,通用网关接口),CGI是外部应用程序(CGI程序)与WEB服务器之间的接口标准,是在CGI程序和Web服务器之间传递信息的过程。CGI规范允许Web服务器执行外部程序,并将它们的输出发送给Web浏览器,CGI将web的一组简单的静态超媒体文档变成一个完整的新的交互式媒体。 FastCGI(Fast Common Gateway

Call PHP from virtual/custom “web server”

ⅰ亾dé卋堺 提交于 2019-11-26 12:46:44
问题 Basically, I\'m trying to figure out how PHP can be called from a \"web server\". I\'ve read the documentation, but it didn\'t help much. As far as I can tell, there are three ways to invoke PHP: via command line (eg: php -f \"/path/to/script.php\" ) via CGI(??) / via FastCGI (???) via a web server (eg: Apache) module So let\'s start with CGI. Maybe I\'m just blind, but the spec doesn\'t mention how on Earth the web server passes data (headers & callbacks) to the thing implementing CGI. The

Dynamically serving a matplotlib image to the web using python

≯℡__Kan透↙ 提交于 2019-11-26 12:25:54
问题 This question has been asked in a similar way here but the answer was way over my head (I\'m super new to python and web development) so I\'m hoping there\'s a simpler way or it could be explained differently. I\'m trying to generate an image using matplotlib and serve it without first writing a file to the server. My code is probably kind of silly, but it goes like this: import cgi import matplotlib.pyplot as pyplot import cStringIO #I think I will need this but not sure how to use ...a