為什麼無法進入cgi-bin????

顯示結果從第 1 筆 到 5 筆,共計 5 筆
  1. #1
    就這樣吧! bentong 的大頭照
    註冊日期
    2001-06-10
    所在地區
    數位電子訊號+足夠的頻寬
    討論區文章
    200

    為什麼無法進入cgi-bin????

    我是用Apache+PHP+Perl+MySQL在Windows下架設的伺服器,
    也修改了httpd.conf檔---> 把cgi-bin指到正確路徑, 並把option 設為ExecCGI可是當我在URL輸入 http://localhost/cgi-bin/test.cgi 作測試時
    卻出現
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected]ress 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.
    ---------------------------------------------------------------------------

    Apache/1.3.14 Server at localhost Port 80


    後來我又在Linux CLE1.0下重新架設, 其結果還是一樣, 我檢查檔案屬性, 都開成777啦, 為何還是無法執行???
    為了確定錯誤訊息在表達什麼,我故意輸入一個不存在的檔案:http://localhost/cgi-bin/not.cgi
    結果出現:
    404 找不到網頁
    查詢的網頁可能已經移除、重新命名或者暫時無法使用。


    -------------------------------------------------------------------------------

    那就表示說先前apache可以定位到我的cgi-bin/test.cgi, 只是它無法執行 我還必須設定與perl有關的參數嗎??? 可是書上都沒提到說??



  2. #2
    就這樣吧! bentong 的大頭照
    註冊日期
    2001-06-10
    所在地區
    數位電子訊號+足夠的頻寬
    討論區文章
    200

    Self test

    後來我把phpNuke架起來,Server都正常沒問題(可以跑.php 和 .html啦)
    於是我把一個index.html 拷貝到cgi-bin的路徑下,然後打http://localhost/cgi-bin/index.html(很簡單的html)
    結果還是
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected]ress 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.
    -------------------------------------------------------------------------------

    Apache/1.3.14 Server at localhost Port 80

    這表示程式本身也沒錯, 那剩下的就是misconfiguration
    但是哪裡還需要設定呢???????
    請大家幫忙腦力激盪一下
    THANKS

  3. #3
    就這樣吧! bentong 的大頭照
    註冊日期
    2001-06-10
    所在地區
    數位電子訊號+足夠的頻寬
    討論區文章
    200

    Never give up!

    終於讓我找到error log :
    ----------------------------------------------------------------------------
    Apache server shutdown initiated...
    [Sat Sep 29 01:46:38 2001] [error] [client 127.0.0.1] attempt to invoke directory as script: /apache/cgi-bin
    [Sat Sep 29 01:46:59 2001] [error] [client 127.0.0.1] (2)No such file or directory: script not found or unable to stat: /apache/cgi-bin/index.htm
    [Sat Sep 29 01:47:04 2001] [error] [client 127.0.0.1] /apache/cgi-bin/index.html is not executable; ensure interpreted scripts have "#!" first line
    [Sat Sep 29 01:47:04 2001] [error] [client 127.0.0.1] couldn't spawn child process: /apache/cgi-bin/index.html

    [Sat Sep 29 02:03:12 2001] [error] [client 127.0.0.1] couldn't spawn child process: /apache/cgi-bin/test.cgi

  4. #4
    就這樣吧! bentong 的大頭照
    註冊日期
    2001-06-10
    所在地區
    數位電子訊號+足夠的頻寬
    討論區文章
    200

    可能是test.cgi出了問題, 但我不會寫正確的cgi

    為什麼無法執行test.cgi, 好,把程式碼叫出來看一下 :
    原來問題就出在第一行
    #!/usr/bin/perl

    ########################################################
    # 環境變量探針 #
    # 您只須將程序上傳,再修改文件屬性為“755”即可使用。 #
    # 如:chmod 755 http://www.web263.com #
    ########################################################
    ## 以下部分不需修改 ##
    ######################
    print "Content-type:text/html\n\n";
    .
    .
    .
    (以下省略)
    ----------------------------------------------------------------
    我本來是要架LB5000, 這個程式好像不多人用,而且先拿來在Win32的平台上試,
    索性就把第一行改成:
    #!\apache\Perl\bin\MSWin32-x86\perl.exe

    結果居然成功了?!^^
    -----------------------------------------
    環境變量探針

    當前目錄的CGI程式文件的絕對路徑 /apache/cgi-bin
    當前目錄的CGI腳本文件的URL相對路徑 http://localhost/cgi-bin
    Perl 版本 5.00503
    當前操作系統 MSWin32
    您的絕對路徑是否要填 絕對路徑不用填
    --------------------------------------------

  5. #5
    就這樣吧! bentong 的大頭照
    註冊日期
    2001-06-10
    所在地區
    數位電子訊號+足夠的頻寬
    討論區文章
    200

    結論

    1.跨平台絕對是趨勢<----這還用說
    2.發問題前該自己先研究一下<----版主別K我灌水,我做了一個示範教材
    3.開放原始碼就是讓大家用的更方便<---永遠支持開放原始碼社團
    Thanks All



類似的主題

  1. 為什麼~我無法進入安全模式
    作者:pk0917082340 所在討論版:-- 電 腦 硬 體 討 論 版
    回覆: 0
    最後發表: 2007-02-27, 10:27 PM
  2. 【求助】為什麼網芳裡無法進入到資料夾
    作者:dragon 所在討論版:-- 網 路 技 術 版
    回覆: 13
    最後發表: 2005-03-05, 02:06 PM
  3. 為什麼我沒法進入ATU-R 呀
    作者:fox99hita 所在討論版:-- 網 路 硬 體 版
    回覆: 6
    最後發表: 2002-01-24, 11:52 PM
  4. ~~無法進入BOIS~~
    作者:ImOK 所在討論版:-- HELP ME 電 腦 軟 硬 體 急 救 版
    回覆: 4
    最後發表: 2002-01-06, 11:00 AM
  5. 無法進入windows me
    作者:pez2978 所在討論版:-- Windows 討 論 版
    回覆: 7
    最後發表: 2001-12-25, 04:17 PM

 

此網頁沒有從搜尋引擎而來的訪客

發表文章規則

  • 不可以發表新主題
  • 不可以回覆文章
  • 不可以上傳附加檔案
  • 不可以編輯自己的文章
  •