MAMP和CGI文件

时间:2013-09-19 23:51:54

标签: php cgi mamp

我正在尝试帮助一位朋友重新设计他的电子商务网站运行PHP(或者至少我假设它是PHP)。我在本地获得了该网站的副本,并且我正在尝试在MAMP中运行它。

我将网站复制到htdocs文件夹,可以很好地进入索引页面。当我尝试登录时,我收到错误:

 Not Found

 The requested URL /cgi-bin/commerce.cgi was not found on this server.

我知道.cgi文件就在那里。有什么特别的东西,我必须与MAMP才能让它正常运行吗?

非常感谢。

1 个答案:

答案 0 :(得分:0)

您可能需要激活cgi。 如果您使用MAMP Pro,主机设置中有一个特殊选项 - 用于启用ExecCGI的高级选项卡。

如果您不使用MAMP Pro,则需要检查apache https.conf文件:

MAMP_cgi_module_MAMPLoadModule cgi_module modules/mod_cgi.so

并且

#
# ScriptAlias: This controls which directories contain server scripts. 
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client.  The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "/Applications/MAMP/cgi-bin/"