cgi

Error 500: Premature end of script headers

情到浓时终转凉″ 提交于 2019-12-17 09:43:09
问题 I get a "Premature end of script headers: contactform.cgi" error message when running the below script. What frustrates me is that I ran this as a .php on another server and it worked. However, I had to change servers and they only support CGI PHP. However, it doesn't work. I don't think the code is wrong, but take a look just in case. I've read around and some have said it's a permissions issue. Could this be the case for me? I know that the "display_errors" and "error_reporting" statements

How Python web frameworks, WSGI and CGI fit together

拜拜、爱过 提交于 2019-12-17 04:08:45
问题 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

special Characters in Perl

不羁的心 提交于 2019-12-16 18:03:24
问题 I'm creating a CGI form to update a Sybase stored procedure. qq {execute procedure test(123,45,date,'$note');}; the $note variable is information obtained from a textbox that contains trouble ticket log information. As such people who enter such information can, and most likely will use special characters such as '|"{} etc. Im curious to know if there is a way to get this information into the database via the variable $note . Most of my research has produced DBI->quote() functions, but they

如何实现一台服务器同时运行两个php版本

冷暖自知 提交于 2019-12-14 16:32:05
有需要学习交流的友人请加入交流群的咱们一起,有问题一起交流,一起进步!前提是你是学技术的。感谢阅读! 点此加入该群 ​jq.qq.com 假设您已经安装了Apache,为这两个项目创建了虚拟主机,并添加了必要的php PPA。让我们调用项目site56.local for php5.6和site70.local for php7.0,通过运行安装php5.6-fpm和php7.0-fpm。 在/usr/lib / cgi-bin /下创建两个文件(老实说我不知道是否还需要这个步骤),并保存。 打开php56 conf文件“ /etc/apache2/conf-available/php5.6-fpm.conf ”添加此配置并保存。 现在启用新的apache配置 如果你安装了php5.6和php5.7,请确保禁用这两个并重新启动apache 在你应该在php7.0上运行的项目上创建一个 .htacces 文件并添加此处理程序 在,在两个项目上创建一个 phpinfo 文件,如果你看到这样的话,那么恭喜你! PS:确保在apache2.conf或httpd.conf中启用htaccess 来源: https://www.cnblogs.com/heyue0117/p/12039973.html

How do I schedule one-time tasks from a Perl CGI application?

空扰寡人 提交于 2019-12-14 03:46:04
问题 I am writing an application to allow users to schedule one-time long-running tasks from a web application (Linux/Apache/CGI::Application). To do this I use the the Schedule::At module which is the Perl interface to the "at" command. Since the scheduled tasks are not repeating, I am not considering "cron". I have two issues with "at" though: Scheduling works fine when my CGI application runs under the suexec wrapper, but not when scheduled by the owner of the Apache process. How can I get

images on CGI or HTML files

不羁的心 提交于 2019-12-14 00:10:04
问题 Recently, I run small local host for myself, but when I write a CGI file or HTML file, it shows everything except images. Does everyone know what happen and what shall I do? 回答1: Impossible to answer because you haven't given us anywhere near enough information. But your code does give one potential clue. use CGI qw/:standard/; use DBI; print "Content-type:text/html\n\n"; print first(); print myform(); print second(); sub myform { return <<B; <form action='' method='post'> <img src="images

How do I set cookies using Perl CGI?

こ雲淡風輕ζ 提交于 2019-12-13 21:58:49
问题 I have tried without success setting cookies using Perl CGI. My code looks like this: $qry = new CGI $cookie = $qry->cookie(-name=>'SERVER_COOKIE', -value=>'USER_NAME', -path=>'/'), $qry->header(-cookie=>$cookie) The page does not throw any error, but no cookie gets set! I am using Firefox 3.5.5 with the add-on to view cookies. What am i doing wrong? Gath 回答1: If your missing semicolons are just an artifact of pasting your question, the key point here is that you need to print the call to

CGI::Cookie fetch does not find cookie

爷,独闯天下 提交于 2019-12-13 21:06:52
问题 i have a problem with setting and getting cookie data. When i call following method: %cookies = CGI::Cookie->fetch; And print out the hash using Data::Dumper: print Dumper(%cookies); My Cookie that was created before with: $sessioncookie = CGI::Cookie->new(-name=>'SID', -value=>"$sid", -expires=>'+1M', -path=>'/member/'); print $cgi->header(-cookie=>$sessioncookie); Does not show up in the output. But it shows up in my browsers cookie list! All values are set and it seems like a normal cookie

How do I get a Ruby CGI program that requires a gem to run properly?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 19:43:14
问题 I have configured my Apache installation to run Ruby CGI scripts. I am now trying to run a simple Ruby CGI script that requires a gem. When I run this script from the command line, it outputs correctly. But when I call it as an Apache CGI script, it generates an Apache Internal Server Error . The script looks like this: #!/Ruby/bin/ruby require 'RedCloth' # <-- This is the gem puts "Content-type: text/html" puts puts puts "<html>" puts "<head>" puts "</head>" puts "<body>" puts "I want to

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

久未见 提交于 2019-12-13 17:54:27
问题 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 furnished by C-language CGI. The finished, displayed image is a prmitive candlestick graph, each candle one pixel wide, something like: http://www.sellmycalls.com/pics/candle-sample.png All of the ~500 images want to be available for redisplay every