在UNIX平台上的Netscape Enterprise Server 3.x下配置PHP

來源:互聯網
上載者:User
作者:polaris(php@yeah.net)
一、基本原理
Netscape Enterprise Server以兩種方式執行CGI程式.

指定一僅包含CGI程式的目錄,所有在該目錄下的程式不管是是什麼尾碼名都被執行  指定以某種尾碼名結尾的程式均為CGI程式,放在伺服器的任何位置都會被執行,PHP程式以該方式執行。

在mime.types中包含magnus-internal/cgi bat,cgi,exe,這告訴Netscape Enterprise Server尾碼名為bat,cgi,exe的程式其類型為magnus-internal/cgi,但預設情況下如果這些程式不放在指定的CGI程式目錄下Netscape
  Enterprise Server將不會執行它們。可以通過Netscape Enterprise Server Manager|Progams|CGI
  File Type,把Activate CGI as a file type選為Yes,然後Save and apply後即可。這樣以bat,cgi,exe結尾的程式放在任何地方都會被執行。
實際上手工在obj.conf檔案中添加
  Service type="magnus-internal/cgi" fn="send-cgi"
  即可。
在Netscape Enterprise Server上執行PHP程式需要一plugin程式模組,在啟動Netscape Enterprise Server時
  會啟動該模組,當用戶端請求PHP程式時該模組會告訴Netscape Enterprise Server,這是個magnus-internal/cgi
  類型的檔案,因此該PHP程式就被執行。
為實現以上功能,在obj.conf檔案中加入
  Init fn="load-modules" funcs="redirect-cgi" \
  shlib="/opt/local/suitespot-3.0/plugins/redirect/redirect_cgi.so"
  NativeThread="no"
  在啟動Netscape Enterprise Server時啟動該模組。
  和
  ObjectType fn="redirect-cgi" cgi_path="/opt/local/www/cgi-bin/php"
  type="magnus-internal/php"
  通過先前啟動的plugin模組告訴Netscape Enterprise Server,類型為magnus-internal/php的檔案,
  需通過/opt/local/www/cgi-bin/php來解釋執行。
在mime.types中加入一行
  magnus-internal/php php3,phtml
  後,Netscape Enterprise Server就知道如何處理尾碼名為php3,phtml的檔案了。
二、具體實現步驟:

  從http://www.webgenx.com/php/phpnes.php3下載原程式後,參考$NETSCAPE_HOME/nsapi/examples目錄下的Makefile檔案,編譯產生redirect_cgi.so檔案。
  把該檔案放置在某一目錄下,例如:/opt/local/suitespot-3.0/plugins/redirect/redirect_cgi.so。
  修改mime.types檔案加入magnus-internal/php php3,phtml。
  
  修改obj.conf,在其它的Init-directives後,加入
    Init fn="load-modules" funcs="redirect-cgi" \
    shlib="/opt/local/suitespot-3.0/plugins/redirect/redirect_cgi.so"
    NativeThread="no"
  
  修改obj.conf
    在ObjectType fn="type-by-extension"和ObjectType fn="force-type"
    type="text/plain"間加入:
    ObjectType fn="redirect-cgi" cgi_path="/opt/local/www/cgi-bin/php"
    type="magnus-internal/php"。
  
  修改obj.conf
    在ObjectType fn="force-type" type="text/plain"和
    Service method="(GET|HEAD)" type="magnus-internal/imagemap"
    fn="imagemap"間加入
    Service type="magnus-internal/cgi" fn="send-cgi"。
  把編譯後產生的php檔案放在/opt/local/www/cgi-bin目錄下。

完成後重新啟動Netscape Enterprise Server即可。  



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.