当前位置: 首页 > 图文教程 > 网络编程 > PHP > 在UNIX平台上的Netscape Enterprise Server 3.x下配置PHP

PHP
《PHP设计模式介绍》第十三章 适配器模式
《PHP设计模式介绍》第十四章 动态记录模式
《PHP设计模式介绍》第十五章 表数据网关模式
《PHP设计模式介绍》第十六章 数据映射模式
《PHP设计模式介绍》第十七章 MVC 模式
Zend Framework 入门——快速上手
Zend Framework 入门——多国语言支持
Zend Framework 入门——错误处理
Zend Framework 入门——页面布局
详细介绍php5编程中的异常处理
PHP5 OOP编程中的代理与异常
PHP程序的常见漏洞攻击分析
PHP.MVC的模板标签系统
PHP教程:PHP编码书写规范
PHP开发大型项目的方法:OOP思想
php使用curl模拟用户登陆
php对gb编码动态转utf-8编码的几种方法评测
php设计模式介绍之章代理模式
“在phpMyAdmin使用用户口令登陆”补充
PHP入门速成

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 145 ::
收藏到网摘: n/a

  作者:polaris([email protected])
一、基本原理
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即可。