在安裝 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"的更多相关文章

  1. Apache Internal Server Error

    当使用 Apache 作为服务器,使用 cgi 程序接收来自 web 端的访问时,出现如下错误: Internal Server Error The server encountered an int ...

  2. PHP如何让apache支持.htaccess 解决Internal Server Error The server …错误

    TP框架  打开 www.newtp.com/index.php/Home/Index/abc出现 如下错误: Internal Server Error The server encountered ...

  3. mvcmovie sample 在window10 下的部署问题(HTTP Error 500.19 - Internal Server Error)

    mvcmovie sample 在window10 下的部署问题 使用VS2018配置好了mvcmovie sample,发布到IIS后,打开报错: HTTP Error 500.19 - Inter ...

  4. EBS Webservice Timeout,HTTP Server Return "500 Internal Server Error"

    http://blog.itpub.net/26687597/viewspace-1207571/ 基于Oracle EBS R12,开发了一个Webservice用于返回某项主数据,当请求的数据量非 ...

  5. 如何让apache支持.htaccess 解决Internal Server Error The server …错误

    如何让apache支持.htaccess 解决Internal Server Error The server …错误 文章来源:小灰博客| 时间:2013-12-25 12:17:08| 作者:Le ...

  6. HTTP 错误 500.21 - Internal Server Error 解决方案

    不久前重新安装了Windows7,在安装了VS2010 开发平台之后,将网站发布到IIS,访问发生如下错误: HTTP 错误 500.21 - Internal Server Error处理程序“Ni ...

  7. HTTP 错误 500.21 - Internal Server Error 处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个错误模块“ManagedPipelineHandler”

    HTTP 错误 500.21 - Internal Server Error 处理程序“PageHandlerFactory-Integrated”在其模块列表中有一个错误模块“ManagedPipe ...

  8. <<< php程序在运行后报“internal server error”错误

    上传的php程序在运行后报“internal server error”错误,检查以下两方面: 1.请您检查php程序的属性是否设置为755,如果php程序的属性不是755,那么运行的时候会报“int ...

  9. HTTP 错误 500.23 - Internal Server Error

    HTTP 错误 500.23 - Internal Server Error 检测到在集成的托管管道模式下不适用的 ASP.NET 设置. IIS8.0详细错误 老版本WEB程序用 VS2013打开时 ...

随机推荐

  1. Maven的配置文件-settings.xml内容分解

    本文转载:https://www.cnblogs.com/jingmoxukong/p/6050172.html 概要 settings.xml有什么用? 如果在Eclipse中使用过Maven插件, ...

  2. sqlalchemy.exc.CompileError: (in table 'user', column 'username'): VARCHAR requires a length on dialect mysql

    映射数据库时报错:sqlalchemy.exc.CompileError: (in table 'user', column 'username'): VARCHAR requires a lengt ...

  3. Java中实现图片的上传

    这边直接存放在c盘的指定目录,在property中指定了一个目录 没有花时间写用户操作的上传页面,直接用swagger2插件,可以上传 默认图片大小超过1mb就不可以上传,可以如下更改 server. ...

  4. JSOI2009 密码 和 JSOI2007 文本生成器 和 ZOJ3545 Rescue the Rabbit

    密码 众所周知,密码在信息领域起到了不可估量的作用.对于普通的登陆口令,唯一的破解 方法就是暴力破解一逐个尝试所有可能的字母组合,但这是一项很耗时又容易被发现的工 作.所以,为了获取对方的登陆口令,在 ...

  5. [Dart] Manipulate Lists/Arrays in Dart

    We will learn how to work with Lists using a variety of methods made available in the dart:core libr ...

  6. 通过反射获取DataSource里数据源的账号密码

    public Connection getDbConnection() { Connection conn = null; // 获得连接 DataSource ds = null; try { Co ...

  7. oracle 备份恢复之recover database的四条语句区别

    1  recover database using backup controlfile2  recover database until cancel3  recover database usin ...

  8. mongodb存储引擎WiredTiger

      MongoDB3.2后默认采用WiredTiger存储引擎. 组成 WiredTiger由三部分组成: Mongos: 负责查询请求的路由和对ShardServer的管理: ConfigServe ...

  9. leetcode解题报告(14):Max Consecutive Ones

    描述 Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: ...

  10. 均匀量化(lena图)

    #include<stdio.h> #include<math.h> #define ROW 512 #define COL 512 typedef unsigned char ...