Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否有人成功地更改了conf.httpd中MAMP的cgi-bin(或docroot)目录?_Mamp - Fatal编程技术网

是否有人成功地更改了conf.httpd中MAMP的cgi-bin(或docroot)目录?

是否有人成功地更改了conf.httpd中MAMP的cgi-bin(或docroot)目录?,mamp,Mamp,我在MAMP中工作,需要为我的项目dicectory创建一个别名,这样我就不必将代码从IDE项目中移到MAMP文件夹中 我已经按照指定配置了conf.httpd,但是得到了404和403 MAMP gui设置中似乎没有任何设置会改变它指向cgi bin的位置,或者只是忽略我的httpd条目,或者我错误地声明它们我不是httpd专家 我的cgi条目如下所示: ScriptAlias /cgi-bin/ "/full/path/to/cgi/folder" 在本例中/full是我的驱动器根目录,而

我在MAMP中工作,需要为我的项目dicectory创建一个别名,这样我就不必将代码从IDE项目中移到MAMP文件夹中

我已经按照指定配置了conf.httpd,但是得到了404和403

MAMP gui设置中似乎没有任何设置会改变它指向cgi bin的位置,或者只是忽略我的httpd条目,或者我错误地声明它们我不是httpd专家

我的cgi条目如下所示:

ScriptAlias /cgi-bin/ "/full/path/to/cgi/folder"
在本例中/full是我的驱动器根目录,而不是Web服务器根目录,尽管我尝试了这两种方法,但都不起作用


有人这样做过吗?我很想知道。

好的。。。这是痛苦和愚蠢的

MAMP/conf/apache/目录中的httpd文件显然没有用于任何用途,如果是,我不知道是什么

您必须进入MAMP应用程序并选择文件->编辑模板->apache 在那里,您将看到MAMP用于启动的实际httpd文件,并且您可以在那里设置ScriptAlias以及您想要的任何其他内容


它也能工作。

我找到了一个补丁,这是一个日本网站提供的,我读日语真是幸运。是的,您需要通过菜单条目File>Edit Template>Apache>httpd.conf来更改httpd.conf。解决方案不是移动现有的cgi bin文件夹,而是使用第二个目录指令添加第二个cgi bin文件夹。这是一段代码及其上下文,在MAMP Pro 2.05中起作用

# "/Applications/MAMP/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/Applications/MAMP/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

# Add the following lines
# This example sets the CGI-BIN folder to a folder
# in the user's home directory Documents/MAMP_Site

<Directory "/Users/myusername/Documents/MAMP_Site">
    Options ExecCGI
    AddHandler cgi-script .cgi .pl
</Directory>