Python + win10 +Apache CGI 错误500的解决方法

来源:互联网 发布:课程表数据库设计 编辑:程序博客网 时间:2024/06/06 03:02

虽然在apache的httpd.conf 配置文件中加了ScriptInterpreterSource Registry

但是还是出现错误500:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, 7678765453@qq.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


网上找了资料:

ScriptInterpreterSource Registry是对Windows注册表项HKEY_CLASSES_ROOT进行搜索来确定CGI脚本解释器

但是只适用于win32

所以可以通过使用在脚本中以"#!"行指定的解释器

将原来test.py文件的第一行

#!/usr/bin/python3

改为自己安装的python目录

#!C:\Python\Python35\python.exe 


再刷新浏览器,发现错误解除。

0 0
原创粉丝点击