IIS 7 中的 Python 中的 Asp 给出 HTTP/1.1 500 服务器错误

2023-07-03Python开发问题
1

本文介绍了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 服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

在xarray中按单个维度的多个坐标分组
groupby multiple coords along a single dimension in xarray(在xarray中按单个维度的多个坐标分组)...
2024-08-22 Python开发问题
15

Pandas中的GROUP BY AND SUM不丢失列
Group by and Sum in Pandas without losing columns(Pandas中的GROUP BY AND SUM不丢失列)...
2024-08-22 Python开发问题
17

pandas 有从特定日期开始的按月分组的方式吗?
Is there a way of group by month in Pandas starting at specific day number?( pandas 有从特定日期开始的按月分组的方式吗?)...
2024-08-22 Python开发问题
10

GROUP BY+新列+基于条件的前一行抓取值
Group by + New Column + Grab value former row based on conditionals(GROUP BY+新列+基于条件的前一行抓取值)...
2024-08-22 Python开发问题
18

PANDA中的Groupby算法和插值算法
Groupby and interpolate in Pandas(PANDA中的Groupby算法和插值算法)...
2024-08-22 Python开发问题
11

PANAS-基于列对行进行分组,并将NaN替换为非空值
Pandas - Group Rows based on a column and replace NaN with non-null values(PANAS-基于列对行进行分组,并将NaN替换为非空值)...
2024-08-22 Python开发问题
10