CGI "Internal Server Error"
在安裝 CGI 程式時如果設定錯誤,便會看到 "500 Internal Server Error" 訊息,一般常見的錯誤可以用以下方法解決:
1. CGI 程式的權限需要設定為 711 或 755。
2. 程式的最開端有一行類似 #!/usr/bin/perl,其中 #! 是必需要的,然後確定 /usr/bin/perl 是正確的路徑,另外這行前不可以有空格或空行。
3. 如果程式本身會讀寫其他檔案,要檢查存取檔案的絕對路徑或相對路徑是否正確,以及檔案是否有權限存取。
4. 根據 HTTP 栛定,在輸出內容前要先輸出 HTTP Headers,否則便會遇上便會錯誤,在 Apache 的 error log 裡面看到的錯誤是 "Premature end of script headers",解決方法是在輸出內容前加一句:
print ("Content-Type: text/html;\n\n");
如大家發現有錯漏,或者有其他補充,觀迎回覆指教。
以上为网络解决:
问题:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>500 Internal Server Error</title> </head> <body> <h1>Internal Server Error</h1> <p>The server encountered an internal error ormisconfiguration and was unable to completeyour request.</p> <p>Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred,and anything you might have done that may havecaused the error.</p>
<p>More information about this error may be availablein the server error log.</p> <hr><address>Apache/2.2.22 (Ubuntu) Server at 192.168.8.111 Port 80</address>< /body> </html>
解决:
添加:
printf ("Content-Type: text/html;\n\n");
即可
CGI "Internal Server Error"的更多相关文章
- Apache Internal Server Error
当使用 Apache 作为服务器,使用 cgi 程序接收来自 web 端的访问时,出现如下错误: Internal Server Error The server encountered an int ...
- PHP如何让apache支持.htaccess 解决Internal Server Error The server …错误
TP框架 打开 www.newtp.com/index.php/Home/Index/abc出现 如下错误: Internal Server Error The server encountered ...
- mvcmovie sample 在window10 下的部署问题(HTTP Error 500.19 - Internal Server Error)
mvcmovie sample 在window10 下的部署问题 使用VS2018配置好了mvcmovie sample,发布到IIS后,打开报错: HTTP Error 500.19 - Inter ...
- EBS Webservice Timeout,HTTP Server Return "500 Internal Server Error"
http://blog.itpub.net/26687597/viewspace-1207571/ 基于Oracle EBS R12,开发了一个Webservice用于返回某项主数据,当请求的数据量非 ...
- 如何让apache支持.htaccess 解决Internal Server Error The server …错误
如何让apache支持.htaccess 解决Internal Server Error The server …错误 文章来源:小灰博客| 时间:2013-12-25 12:17:08| 作者:Le ...
- HTTP 错误 500.21 - Internal Server Error 解决方案
不久前重新安装了Windows7,在安装了VS2010 开发平台之后,将网站发布到IIS,访问发生如下错误: HTTP 错误 500.21 - Internal Server Error处理程序“Ni ...
- HTTP 错误 500.21 - Internal Server Error 处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个错误模块“ManagedPipelineHandler”
HTTP 错误 500.21 - Internal Server Error 处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个错误模块“ManagedPipe ...
- <<< php程序在运行后报“internal server error”错误
上传的php程序在运行后报“internal server error”错误,检查以下两方面: 1.请您检查php程序的属性是否设置为755,如果php程序的属性不是755,那么运行的时候会报“int ...
- HTTP 错误 500.23 - Internal Server Error
HTTP 错误 500.23 - Internal Server Error 检测到在集成的托管管道模式下不适用的 ASP.NET 设置. IIS8.0详细错误 老版本WEB程序用 VS2013打开时 ...
随机推荐
- RedisTemplate的key默认序列化器问题
原文:https://blog.csdn.net/skymouse2002/article/details/80736577 redis的客户端换成了spring-boot-starter-data- ...
- TIME_WAIT状态全是3306解决办法
刚吃完晚饭,手机短信一直响个不停,打开一看全是告警信息,立即打开电脑查看,发现很多网页很不稳定 一会能打开,一会打不开 登录服务器查看负载情况,cpu.内存 .磁盘io 负载都不高,查看日志发现ng ...
- apache配置https加密传输
环境:两台linux虚拟机和一台windows本机,一台充当要使用https传输的web服务器apache2.4.4,另一台CA服务器,window测试https配置. 1.CA服务器生成私有CA 1 ...
- 链表实现队列(python)
# -*- coding: utf-8 -*- from collections import deque class Node(object): def __init__(self, value=N ...
- MySQL进阶14--标识列(自增序列/auto_increment)--设置/展示步长--设置/删除标示列
/*进阶14 标识列 又称为自增序列; 含义 : 可以不用手动的插入值, 系统提供默认的序列值(1-->n) 特点 : 1.标识列必须和主键搭配? 不一定,但要求是一个key 2.一个表可以有几 ...
- P1080 【NOIP 2012】 国王游戏[贪心+高精度]
题目来源:洛谷 题目描述 恰逢 H国国庆,国王邀请n 位大臣来玩一个有奖游戏.首先,他让每个大臣在左.右手上面分别写下一个整数,国王自己也在左.右手上各写一个整数.然后,让这 n 位大臣排成一排,国王 ...
- xcode 查看stastic
点GPU 双击柱状图 从上面list里点performance
- logging 为全局的日志工具对象添加日志记录器
def log_file(LEVEL_NAME): # 设置日志的记录等级,常见的有四种,大小关系如下,DEBUG < INFO < WARNING <ERROR # 一旦设置级别, ...
- JS转换HTML转义符 [转]
最近有个需求,就是后台系统编辑文章内容存到后台,前端这边获取到是转义后的字符串,如果直接将转义后的内容写在页面上,html标签不会被解析.网上找到觉得不错的功能函数,这里记录一下 //去掉html标签 ...
- Linux(centos 7) 安装nginx
在安装nginx之前需要安装依赖的包 一. gcc 安装安装 nginx 需要先将官网下载的源码进行编译,编译依赖 gcc 环境,如果没有 gcc 环境,则需要安装: yum install gcc- ...