level 1
王与香辛料1
楼主
利用Python编写CGI,Windows配置好Apache, 但是浏览器提示错误如下:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
这是日志文件的错误
::1 - - [25/Aug/2021:17:56:20 +0800] "GET /cgi-bin/hello.py HTTP/1.1" 500 530
::1 - - [25/Aug/2021:17:56:25 +0800] "GET /cgi-bin/hello.py HTTP/1.1" 500 530
这是我的文件
#!E:\pycharm\PyCharm Community Edition 2020.3.3\bin\pycharm64.exe
# -*- coding: UTF-8 -*-
print ("Content-type:text/html")
print # 空行,告诉服务器结束头部
print ('<html>')
print ('<head>')
print ('<meta charset="utf-8">')
print ('<title>Hello World - 我的第一个 CGI 程序!</title>')
print ('</head>')
print ('<body>')
print ('<h2>Hello World! 我的第一个CGI程序</h2>')
print ('</body>')
print ('</html>')
请问是哪里的问题啊,萌新实在找不到原因....
2021年08月25日 10点08分
1
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
这是日志文件的错误
::1 - - [25/Aug/2021:17:56:20 +0800] "GET /cgi-bin/hello.py HTTP/1.1" 500 530
::1 - - [25/Aug/2021:17:56:25 +0800] "GET /cgi-bin/hello.py HTTP/1.1" 500 530
这是我的文件
#!E:\pycharm\PyCharm Community Edition 2020.3.3\bin\pycharm64.exe
# -*- coding: UTF-8 -*-
print ("Content-type:text/html")
print # 空行,告诉服务器结束头部
print ('<html>')
print ('<head>')
print ('<meta charset="utf-8">')
print ('<title>Hello World - 我的第一个 CGI 程序!</title>')
print ('</head>')
print ('<body>')
print ('<h2>Hello World! 我的第一个CGI程序</h2>')
print ('</body>')
print ('</html>')
请问是哪里的问题啊,萌新实在找不到原因....