ASP在IIS 7蟒蛇是给HTTP / 1.1 500服务器错误
我使用Windows 7和IIS 7不是管理员,但作为用户。我已经安装了ASP模块和CGI模块IIS 7应用开发功能。我简单的传统的ASP页面被工作是:
I am using Windows 7 and IIS 7 not as administrator but as a user. I have installed asp module and cgi module in IIS 7 in application development feature. My simple classic asp page is working which is :
<%response.write("Hello World")%>
我在Python CGI是工作是:
My cgi in python is working which is :
print "Content-Type: text/plain;charset=utf-8"
print "Hello World!"
但是,当我使用ASP页面内Python脚本它显示HTTP / 1.1 500服务器错误
在code我用的是:
But when I am using python script inside asp page it is showing HTTP/1.1 500 server error The code I am using is :
<%@Language=Python%>
<%
x="Hello"
response.write(x)
%>
我已搜查了净4天,但没有得到任何运气。
我启用了匿名身份验证,在验证,未注册和注册ASP的pyscript.py,与IUSR提供蟒蛇,并给IUSR完全控制,启用启用32位应用程序为True剪掉的工作。
I have searched the net for 4 days but didnt get any luck. I enabled "Anonymous Authentication" in Authentication ,Unregistered and registered the pyscript.py for ASP, Provided python with IUSR and gave IUSR full control,Enabled "Enable-32 Bit Application" to True didnt worked.
我终于找到了解决的办法。
Finally I found the solution to it.
要执行的步骤
-
注册的Python与ASP:
Register Python with ASP:
- 开启命令提示符
- 到
{python_installation_dir} \\ LIB \\站点包\\ win32comext \\ axscript \\客户端
- 运行
蟒蛇pyscript.py
- Open Command Prompt
- Go to
{python_installation_dir}\Lib\site-packages\win32comext\axscript\client
- Run
python pyscript.py
启用IIS7 32位应用程序
Enable 32-bit application for IIS7
- 转到 IIS7
- 右键点击您的网站的应用程序池
- 选择高级设置
- 在常规,将启用32位应用程序为真
- Go to IIS7
- Right click on your site's application pool
- Select Advanced Settings
- Under General, set Enable 32-Bit Application to True
添加 IIS_IUSRS IUSR 或用户以您的虚拟目录:
Add IIS_IUSRS, IUSR or USERS to your virtual directory:
- 右键点击目录
- 点击修改权限
- 选择安全标签。
- 给予该帐户至少读权限。