在 Ubuntu 中执行 .cgi 文件 [英] Execute a .cgi file in Ubuntu

查看:18
本文介绍了在 Ubuntu 中执行 .cgi 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ubuntu 下运行 Apache/PHP

I am running Apache/PHP under Ubuntu

当我运行 .cgi 文件时,通过访问 http://localhost/mycgi.cgi,浏览器将显示代码而不是运行它.

When I run the .cgi file, by going at http://localhost/mycgi.cgi, the browser will display the code instead of running it.

如何让浏览器执行 CGI 文件而不是显示其内容?

How do I make the browser execute the CGI file instead of showing its contents?

推荐答案

将这些行添加到您的 apache2.conf 文件中

Add these lines to your apache2.conf file

<Directory /usr/local/apache2/htdocs/somedir>
    Options +ExecCGI
</Directory>

AddHandler cgi-script .cgi .pl

这篇关于在 Ubuntu 中执行 .cgi 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆