学习python CGI时运行的报错

将py文件放在了cgi-bin文件夹中,python中写的信息为:

学习python CGI时运行的报错

 

在浏览器中输入http://localhost:8083/cgi-bin/studyCGI.py后提示:

Internal Server Error

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

Please contact the server administrator at admin@example.com 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.

 

error log中的提示信息为:

学习python CGI时运行的报错

 

 解决方式是将解释器放在第一行!!!一定要在第一行:

学习python CGI时运行的报错

 

再运行就提示正常了

 

学习python CGI时运行的报错

 

上一篇:理论篇·Linux常用命令详解(cd、ls、du、touch、ln、cp、rm、mv、which、find)


下一篇:ubuntu16.04安装apache(httpd)支持cgi