【问题标题】:Server error 500 when executing simple "Hello, world" in Python XAMPP [closed]在 Python XAMPP 中执行简单的“Hello, world”时出现服务器错误 500 [关闭]
【发布时间】:2018-12-17 00:58:43
【问题描述】:

我正在尝试执行此代码:

#!C:\python-3.7.0-embed-amd64\python.exe

print('Content-type: text/html\r\n')
print('\r\n')
print('Hello, World!')

我得到了这个错误:

服务器错误!
服务器遇到内部错误,无法完成您的请求。服务器过载或 CGI 脚本出错。

如果您认为这是服务器错误,请联系网站管理员。

错误 500
本地主机
Apache/2.4.33 (Win32) OpenSSL/1.1.0h PHP/7.2.6

什么可能导致这个问题?

【问题讨论】:

    标签: python xampp http-status-code-500


    【解决方案1】:

    确保 shebang (#!) 之前没有空格或制表符。那是我的问题。

    它必须在文件的第一个字符位置。

    【讨论】:

    • 这是我的问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-20
    • 2022-07-13
    • 2014-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多