IIS 7 中的 Python 中的 Asp 给出 HTTP/1.1 500 服务器错误 [英] Asp in python in IIS 7 is giving HTTP/1.1 500 Server Error

查看:86
本文介绍了IIS 7 中的 Python 中的 Asp 给出 HTTP/1.1 500 服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是以管理员身份而是以用户身份使用 Windows 7 和 IIS 7.我在 IIS 7 中的应用程序开发功能中安装了 asp 模块和 cgi 模块.我的简单经典 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 服务器错误我使用的代码是:

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,为 python 提供了 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.

推荐答案

终于找到了解决办法.

要执行的步骤是

  1. 向 ASP 注册 Python:

  1. Register Python with ASP:

  • 打开命令提示符
  • 转到 {python_installation_dir}Libsite-packageswin32comextaxscriptclient
  • 运行 python pyscript.py

为 IIS7 启用 32 位应用程序

Enable 32-bit application for IIS7

  • 转到 IIS7
  • 右键单击您网站的应用程序池
  • 选择高级设置
  • 常规下,将启用 32 位应用程序设置为 True
  • Go to IIS7
  • Right click on your site's application pool
  • Select Advanced Settings
  • Under General, set Enable 32-Bit Application to True

IIS_IUSRSIUSRUSERS 添加到您的虚拟目录:

Add IIS_IUSRS, IUSR or USERS to your virtual directory:

  • 右击目录
  • 点击编辑权限
  • 选择安全标签.
  • 至少授予帐户读取权限.

这篇关于IIS 7 中的 Python 中的 Asp 给出 HTTP/1.1 500 服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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