脚本代码肯定没问题, 我上传到我一个虚拟空间, 同样的目录和文件, 在他那里就可以运行 # # 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/ "E:/Inetpub/wwwroot/Soft/cgi-bin/"</IfModule><IfModule cgid_module> # # ScriptSock: On threaded servers, designate the path to the UNIX # socket used to communicate with the CGI daemon of mod_cgid. # #Scriptsock logs/cgisock </IfModule># # "${path}/apache/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory "E:/Inetpub/wwwroot/Soft/cgi-bin/"> AllowOverride All Options ExecCGI Order allow,deny Allow from all </Directory>
你要用cgi-bin就配置服务器使它支持cgi-bin, 并安装cgi-bin必要的模块就可以了。
可是我已经配置了好了cgi-bin, 总是500错误, 要么403错误.我的是vista, 开了UAC, 但是我已经用管理权权限启动了 apache.找了好多资料, 一步一步的做, 还是不行. 找不到原因在哪里了.
#
# 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/ "E:/Inetpub/wwwroot/Soft/cgi-bin/"</IfModule><IfModule cgid_module>
#
# ScriptSock: On threaded servers, designate the path to the UNIX
# socket used to communicate with the CGI daemon of mod_cgid.
#
#Scriptsock logs/cgisock
</IfModule>#
# "${path}/apache/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "E:/Inetpub/wwwroot/Soft/cgi-bin/">
AllowOverride All
Options ExecCGI
Order allow,deny
Allow from all
</Directory>