cgi

Can I run php script under user permissions with FastCGI and APACHE?

青春壹個敷衍的年華 提交于 2019-12-11 10:49:59
问题 I would like to install Apache and PHP but I have read that mod_php is very slow. Many php developers have adviced me to use FastCGI. Can I run my php script with a specific user:group? (each vhost has different user:group) I know there is suphp but is slow too.. Thank you so much! 回答1: Here is a recipe that uses suexec. 来源: https://stackoverflow.com/questions/5915333/can-i-run-php-script-under-user-permissions-with-fastcgi-and-apache

How do I access HTTP request headers in HTTP::Server::Simple::CGI?

杀马特。学长 韩版系。学妹 提交于 2019-12-11 10:12:14
问题 I'm using HTTP::Server::Simple::CGI for a light-weight HTTP server. That gives me a CGI object in a callback function when a HTTP request is accepted. How can I access the incoming HTTP headers, especially non-standard headers? The environment variables are only the standard ones. cgi->param gives me only the form parameters. Thanks! chris 回答1: It says in the documentation: You can, if you really want, define parse_headers() and parse them raw yourself. 回答2: Define the headers method to

Run an .exe file on apache?

橙三吉。 提交于 2019-12-11 09:55:03
问题 I'm trying to run a cgi executable file through a html form as in this code: <html> <head> <title>CGI Form</title> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> </head> <body> <form action="C:\WWW\cgi-bin\y.exe" method="get"> <input type="text" name="string1" /> <input type="text" name="string2" /> <input type="text" name="string3" /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> And here it is the cgi code compiled as y.exe and saved in

How to return a 500 HTTP status from a C++ CGI program

最后都变了- 提交于 2019-12-11 09:27:37
问题 I have a small "SOAP CGI gatewqay" C++ program that reads an HTTP SOAP request from cin , get the request info from it and sends it to the legacy server. Then it taks the response, format it as a SOAP response and write it to cout . In case of an error, it writes a <SOAP-ENV:Fault> reponse to cout . However, the SOAP standard says that in case of error, the returned HTTP status should be 500 "Internal Server Error". This SOAP CGI gateway should run on any web server that supports CGI. What is

Adding a stream embed on click

倖福魔咒の 提交于 2019-12-11 09:26:07
问题 I'm trying to make it so when you click a div it replaces the div with an embed (https://github.com/justintv/Twitch-API/blob/master/embedding.md). Currently what i have is this: http://pastebin.com/5N3hqWz3 (live at www.splinksy.com) Im able to get divs to replace to "test" when i click them, but i cant get them to be replaced by the embed object. Also, is it possible to replace the whole webpage with the embed once they click one of the links (erase the list and replace it with one embed) 来源

CGI download image after generating

人走茶凉 提交于 2019-12-11 08:52:39
问题 I have a small python cgi script that accepts an image upload from the user, converts in into a different format, and saves the new file in a temp location. I would like it to then automatically prompt the user to download the converted file. I have tried: # image conversion stuff.... print "Content-Type: image/eps\n" #have also tried application/postscript, and application/eps print "Content-Disposition: attachment; filename=%s\n" % new_filename #have tried with and without this... print

Undefined subroutine CGI::radio

这一生的挚爱 提交于 2019-12-11 08:49:49
问题 I have an application about a student data,and i am trying to make a radio-group which has options about gender of the student. But it shows me the following error: Undefined subroutine CGI::radio at C:/wamp/bin/apache/apache2.2.22/cgi-bin/modify.pl line 196 $cInput .= $q->div({-class => 'control-group'}, $q->label({-class => 'control-label', -for => 'gender'}, "Gender:"), $q->div({class => 'controls'}, $q->span({class => 'span12'}, $q->label({-class => 'blue'}, $q->radio-group({-id =>

return http error code from CGI C module

。_饼干妹妹 提交于 2019-12-11 08:48:15
问题 I've a CGI module written in C & for some condition I want to return HTTP error 400 from this module. The problem is - I don't know how to return HTTP error from the module. Looks like the 'return(-1)' in my module, returns the 500 internal server error. I've tried returning 400 etc. but in vein. I've even tried "printf("Status:400");" before returning -1 (as suggested here: How to return a 500 HTTP status from a C++ CGI program ) but that didn't work. Any advice on this would be appreciated.

Web page file upload is always corrupted

北城以北 提交于 2019-12-11 08:42:41
问题 I am trying to add a file upload to an existing web page. Every time I upload I get a file that is corrupted. I made sure to set binmode on the file handle. I also have my input enctype set to multipart/formdata in my form. My code is as follows $article{upload_file_name} = $cgi->param( 'upFile' ); $article{upload_file} = $cgi->upload( 'upFile' ); if ( $article{upload_file_name} ne "" or $article{upload_file_name} ne null ) { open( UPLOADS, ">$uploads_dir/$article{upload_file_name}" ) or die

Perl-CGI Image is displayed in browser as binary

我怕爱的太早我们不能终老 提交于 2019-12-11 08:15:11
问题 I was programming a little plugin, which generates an image via Perl GD and displays it in the browser. So far everything works correct, except that the image is displayed in binary character stream. It's rather annoying to google this kind of problem, because I read about temporarily saving the file to the hard disk, which I would love to avoid. This is the code I have so far: $image = $print->png; ## the image was created correctly, I was able to #view it if I saved it on the local drive my