apache用cgi脚本碰到的错误

在使用Apache服务器运行CGI脚本时遇到问题,表现为通过浏览器访问出现错误,而本地直接执行脚本则正常。错误日志显示了详细的问题,通过对日志的分析和调试,逐步解决了CGI脚本的运行故障。
摘要由CSDN通过智能技术生成

诡异错误

浏览器访问脚本出错,本地执行没问题:

[root@Sven cgi-bin]# ./simple2.cgi 
Content-type: text/plain
Hello, world!


错误详情

url访问脚本出现以下错误:

Internal Server Error

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

Please contact the server administrator, root@localhost 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.

CGI脚本

#!/usr/bin/env python3

import cgi


form = cgi.FieldStorage()

name = form.getvalue('name', 'world')

print('Content-type: text/plain')
print('Hello, %s!' % name)</
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值