[英]Asp in python in IIS 7 is giving HTTP/1.1 500 Server Error
I am using Windows 7 and IIS 7 not as administrator but as a user. 我不是以管理员身份而是以用户身份使用Windows 7和IIS 7。 I have installed asp module and cgi module in IIS 7 in application development feature. 我已经在IIS 7中的应用程序开发功能中安装了asp模块和cgi模块。 My simple classic asp page is working which is : 我简单的经典ASP页面正在工作,它是:
<%response.write("Hello World")%>
My cgi in python is working which is : 我在python中的cgi正在工作,它是:
print "Content-Type: text/plain;charset=utf-8"
print "Hello World!"
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 : 但是当我在asp页面中使用python脚本时,它显示HTTP / 1.1 500服务器错误我正在使用的代码是:
<%@Language=Python%>
<%
x="Hello"
response.write(x)
%>
I have searched the net for 4 days but didnt get any luck. 我已经在网上搜索了4天,但没有得到任何运气。 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. 我在身份验证中启用了“匿名身份验证”,未注册并为ASP注册了pyscript.py,向python提供了IUSR并给予了IUSR完全控制权,为True启用了“启用32位应用程序”无效。
Finally I found the solution to it. 最后,我找到了解决方案。
The steps to be performed are 要执行的步骤是
Register Python with ASP: 用ASP注册Python:
{python_installation_dir}\\Lib\\site-packages\\win32comext\\axscript\\client
转到{python_installation_dir}\\Lib\\site-packages\\win32comext\\axscript\\client
python pyscript.py
运行python pyscript.py
Enable 32-bit application for IIS7 为IIS7启用32位应用程序
Add IIS_IUSRS , IUSR or USERS to your virtual directory: 将IIS_IUSRS , IUSR或USERS添加到您的虚拟目录中:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.