Win2000下IIS中配置PHP具体方法

 更新时间:2016年11月25日 15:17  点击:2026
 PHP是一种领先于ASP的技术。与ASP相比,它具有速度快、稳定性高、跨平台、易学习等优点。ASP学习者使用的OS几乎都是Windows平台,上面无疑都装有IIS。PHP所需求的服务器支持主要是由Apache提供的。事实上,IIS也可以提供这样的支持,具体步骤如下:
    1.    下载PHP。推荐网址:http://www.onlinedown.net/soft/1774.htm    下载后解压到一个文件夹里,推荐解压:C:php 里。以下都将使用这一文件夹描述。
    2.    将C:php里的dlls文件夹里的所有文件复制并粘贴到C:winnt ystem32里。再将C:php下的php4ts.dll复制到C:winnt ystem32下。
    3.    用记事本打开C:php下的php.ini-dist文件。找到如下一行:extension_dir = "./" 将其改为 extension_dir = C:php 将其保存到C:winnt ystem32下,注意:名为php.ini
    4.    首先打开控制面板-〉管理工具-〉internet服务管理器-〉展开左边的目录树-〉默认web站点-〉点击右键-〉属性-〉isapi筛选器->添加->筛选器名称:php;可执行文件:C:php apiphp4isapi.dll 然后再打开默认web站点属性面板下的主目录-〉配置-〉添加-〉可执行文件:C:php apiphp4isapi.dll;扩展名:php。
好了,大功告成了!

ServerRoot directive
Syntax: ServerRoot directory-filename
Default: ServerRoot /usr/local/apache
Context: server config
Status: core
The ServerRoot directive sets the directory in which the server lives. Typically it will contain the subdirectories conf/ and logs/. Relative paths for other configuration files are taken as relative to this directory.
See also the -d option to httpd.
See also the security tips for information on how to properly set permissions on the ServerRoot.
--------------------------------------------------------------------------------
ServerSignature directive
Syntax: ServerSignature Off | On | EMail
Default: ServerSignature Off
Context: server config, virtual host, directory, .htaccess
Status: core
Compatibility: ServerSignature is only available in Apache 1.3 and later.
The ServerSignature directive allows the configuration of a trailing footer line under server-generated documents (error messages, mod_proxy ftp directory listings, mod_info output, ...). The reason why you would want to enable such a footer line is that in a chain of proxies, the user often has no possibility to tell which of the chained servers actually produced a returned error message.
The Off setting, which is the default, suppresses the error line (and is therefore compatible with the behavior of Apache-1.2 and below). The On setting simply adds a line with the server version number and ServerName of the serving virtual host, and the EMail setting additionally creates a "mailto:" reference to the ServerAdmin of the referenced document.
--------------------------------------------------------------------------------
ServerTokens directive
Syntax: ServerTokens Minimal|OS|Full
Default: ServerTokens Full
Context: server config
Status: core
Compatibility: ServerTokens is only available in Apache 1.3 and later
This directive controls whether Server response header field which is sent back to clients includes a description of the generic OS-type of the server as well as information about compiled-in modules.
作为一个新生事物,Linux吸引了不少眼球,但是它能否快捷、方便地与Windows资源共享,是一个很重要的问题。大家知道,Windows之间可以利用“网络邻居”来实现资源共享,而Linux之间可以使用NFS来实现资源共享。那么,Linux与Windows之间呢?
Linux可以通过Samba来实现和Windows主机互通有无的。Samba采用Client/Server架构,执行Samba客户端程序,就可以访问Windows主机上的共享资源;而运行Samba服务器,Windows主机就可以访问Linux上的共享资源。下面以Red Hat 8.0为例,介绍在Linux环境里如何访问Windows共享资源。
  安装Samba
  如果不能确定是否已经安装了Samba软件包,可以在终端窗口执行以下命令进行查询:
$ rpm -qa | grep samba
  如果查询结果出现如图1所示的三个软件包,则表示已经安装Samba软件包。

  图一:查询是否安装Samba软件包
  如果没有安装过Samba软件包,则可以插入Red Hat 8.0第二张安装光盘,然后按照下面的步骤进行安装(以KDE环境为例):
  1. 鼠标依次单击主选单→系统设置→“软件包”选单项,将会打开“软件包管理”对话框。
  2. 在该对话框里找到“Windows文件服务器”,确保已经勾选该选项,然后单击对话框底部的“更新”按钮,如图2所示。
  3. 安装Samba软件包。

  图三:安装Samba软件包
  整个过程非常简单,系统会自动检测软件包之间的依赖性,完全不用操心。
  用命令方式访问Windows
  安装好Samba之后,就可以让它大显身手了。这里先介绍如何用字符命令方式访问Windows共享资源。
  1. 查询Windows主机的共享资源
  查询Windows主机的共享资源可以使用smbclient -L WindowsHostName命令。例如,要查询一台名为Peter的Windows主机上的共享资源,可以在终端窗口输入:
smbclient -L Peter
  然后回车即可。该命令的具体使用方法如图3所示。该命令可以准确地检查出Windows主机的共享文件夹,并且对中文文件名的支持也很好。

  图三:查询Windows主机的共享资源
  2. 连接Windows主机的共享目录
  我们可以使用“smbclient //WindowsHostName/ShareName”命令,连接Windows主机上的某个共享文件夹。如果该共享文件夹需要用户名和密码,则可以使用“smbclient //WindowsHostName/ShareName -U UserName”命令。例如,要连接Windows主机Peter上的共享目录Share,可以在终端窗口输入:
<Location> directive
Syntax: <Location URL> ... </Location>
Context: server config, virtual host
Status: core
Compatibility: Location is only available in Apache 1.1 and later.
The <Location> directive provides for access control by URL. It is similar to the <Directory> directive, and starts a subsection which is terminated with a </Location> directive. <Location> sections are processed in the order they appear in the configuration file, after the <Directory> sections and .htaccess files are read, and after the <Files> sections.
Note that URLs do not have to line up with the filesystem at all, it should be emphasized that <Location> operates completely outside the filesystem.
For all origin (non-proxy) requests, the URL to be matched is of the form /path/, and you should not include any http://servername prefix. For proxy requests, the URL to be matched is of the form scheme://servername/path, and you must include the prefix.
The URL may use wildcards In a wild-card string, `?' matches any single character, and `*' matches any sequences of characters.
Apache 1.2 and above: Extended regular expressions can also be used, with the addition of the ~ character. For example:
     <Location ~ "/(extra|special)/data">
would match URLs that contained the substring "/extra/data" or "/special/data". In Apache 1.3 and above, a new directive <LocationMatch> exists which behaves identical to the regex version of <Location>.
The Location functionality is especially useful when combined with the SetHandler directive. For example, to enable status requests, but allow them only from browsers at foo.com, you might use:
    <Location /status>
    SetHandler server-status
    order deny,allow
    deny from all
先安装mysql,用winzip8.0打开软件包进行完全安装,默认安装路径为:c:mysql;
    安装完成后,打开“开始”按钮中的“运行”,输入命令:C:mysqlinmysqld-nt.exe --install,并执行;
    打开“开始”按钮下的“程序”=》“管理工具”=》“服务”,找到“mysql”服务,启动它;
    至此,mysql安装完成,重启win2000adanced server。您还可以打开C:mysqlinwinmysqladmin.exe,在第一次用它时,需要建立管理员名及密码,我分别设置为root和(yourpassword)。关闭它后,程序自动在状态行下建立一个“红绿灯”的小图标。
    
    现在开始安装php4,将软件包先用winzip解压到c:php4下,再将目录下的所有dll文件拷到c;winntsystem32下,不要覆盖已有的dll文件;接着将目录下的php.exe和php.ini-dist两个文件拷到c:winnt下;
    将c:winntphp.ini-dist改名为php.ini,并打开它,找到;Windows Extensions,将extension=php_calendar.dll、extension=php_zlib.dll、extension=php_ldap.dll前的“;”去掉,关闭该文件。
    打开“开始”按钮下的“程序”=》“管理工具”=》“internet服务管理器”,选中“默认web站点”,打开它的“属性”窗口。在“web站点”页下,改变“IP地址”:“全部未分配”为“(您机子的ip地址,例如:202.195.243.131)”;“TCP端口”为“80”。
    
    接着,选中“主目录”页,单击“应用程序设置”下的“配置”按钮后,在新窗口下单击“添加”按钮;在“可执行文件”中输入“C:WINNTphp.exe     %s %s”,在“扩展名”中输入“.php”,点击“确定”。
    接着,选中“ISAPI筛选器”页,单击“添加”按钮;在“筛选器名称”中输入“php”,在“可执行文件”中输入“C:WINNTsystem32php4isapi.dll”,点击“确定”。
    接着,选中“文档”页,单击“添加”按钮;在“默认文档名”中输入“index.php”,点击“确定”,并将其提高到最高级。您还可以添加常用的php文件名,如:“default.phtml”、“index.php3”等。
    关闭所有窗口,重启系统后,可打开IE浏览器进行测试。

[!--infotagslink--]

相关文章

  • php 中file_get_contents超时问题的解决方法

    file_get_contents超时我知道最多的原因就是你机器访问远程机器过慢,导致php脚本超时了,但也有其它很多原因,下面我来总结file_get_contents超时问题的解决方法总结。...2016-11-25
  • HTTP 408错误是什么 HTTP 408错误解决方法

    相信很多站长都遇到过这样一个问题,访问页面时出现408错误,下面一聚教程网将为大家介绍408错误出现的原因以及408错误的解决办法。 HTTP 408错误出现原因: HTT...2017-01-22
  • php抓取网站图片并保存的实现方法

    php如何实现抓取网页图片,相较于手动的粘贴复制,使用小程序要方便快捷多了,喜欢编程的人总会喜欢制作一些简单有用的小软件,最近就参考了网上一个php抓取图片代码,封装了一个php远程抓取图片的类,测试了一下,效果还不错分享...2015-10-30
  • Android子控件超出父控件的范围显示出来方法

    下面我们来看一篇关于Android子控件超出父控件的范围显示出来方法,希望这篇文章能够帮助到各位朋友,有碰到此问题的朋友可以进来看看哦。 <RelativeLayout xmlns:an...2016-10-02
  • ps把文字背景变透明的操作方法

    ps软件是现在非常受大家喜欢的一款软件,有着非常不错的使用功能。这次文章就给大家介绍下ps把文字背景变透明的操作方法,喜欢的一起来看看。 1、使用Photoshop软件...2017-07-06
  • intellij idea快速查看当前类中的所有方法(推荐)

    这篇文章主要介绍了intellij idea快速查看当前类中的所有方法,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下...2020-09-02
  • Mysql select语句设置默认值的方法

    1.在没有设置默认值的情况下: 复制代码 代码如下:SELECT userinfo.id, user_name, role, adm_regionid, region_name , create_timeFROM userinfoLEFT JOIN region ON userinfo.adm_regionid = region.id 结果:...2014-05-31
  • js导出table数据到excel即导出为EXCEL文档的方法

    复制代码 代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta ht...2013-10-13
  • mysql 批量更新与批量更新多条记录的不同值实现方法

    批量更新mysql更新语句很简单,更新一条数据的某个字段,一般这样写:复制代码 代码如下:UPDATE mytable SET myfield = 'value' WHERE other_field = 'other_value';如果更新同一字段为同一个值,mysql也很简单,修改下where即...2013-10-04
  • js基础知识(公有方法、私有方法、特权方法)

    本文涉及的主题虽然很基础,在许多人看来属于小伎俩,但在JavaScript基础知识中属于一个综合性的话题。这里会涉及到对象属性的封装、原型、构造函数、闭包以及立即执行表达式等知识。公有方法 公有方法就是能被外部访问...2015-11-08
  • ps怎么制作倒影 ps设计倒影的方法

    ps软件是一款非常不错的图片处理软件,有着非常不错的使用效果。这次文章要给大家介绍的是ps怎么制作倒影,一起来看看设计倒影的方法。 用ps怎么做倒影最终效果&#819...2017-07-06
  • PHP 验证码不显示只有一个小红叉的解决方法

    最近想自学PHP ,做了个验证码,但不知道怎么搞的,总出现一个如下图的小红叉,但验证码就是显示不出来,原因如下 未修改之前,出现如下错误; (1)修改步骤如下,原因如下,原因是apache权限没开, (2)点击打开php.int., 搜索extension=ph...2013-10-04
  • c#中分割字符串的几种方法

    单个字符分割 string s="abcdeabcdeabcde"; string[] sArray=s.Split('c'); foreach(string i in sArray) Console.WriteLine(i.ToString()); 输出下面的结果: ab de...2020-06-25
  • 安卓手机wifi打不开修复教程,安卓手机wifi打不开解决方法

    手机wifi打不开?让小编来告诉你如何解决。还不知道的朋友快来看看。 手机wifi是现在生活中最常用的手机功能,但是遇到手机wifi打不开的情况该怎么办呢?如果手机wifi...2016-12-21
  • js控制页面控件隐藏显示的两种方法介绍

    javascript控制页面控件隐藏显示的两种方法,方法的不同之处在于控件隐藏后是否还在页面上占位 方法一: 复制代码 代码如下: document.all["panelsms"].style.visibility="hidden"; document.all["panelsms"].style.visi...2013-10-13
  • 连接MySql速度慢的解决方法(skip-name-resolve)

    最近在Linux服务器上安装MySql5后,本地使用客户端连MySql速度超慢,本地程序连接也超慢。 解决方法:在配置文件my.cnf的[mysqld]下加入skip-name-resolve。原因是默认安装的MySql开启了DNS的反向解析。如果禁用的话就不能...2015-10-21
  • C#方法的总结详解

    本篇文章是对C#方法进行了详细的总结与介绍,需要的朋友参考下...2020-06-25
  • Zend studio文件注释模板设置方法

    步骤:Window -> PHP -> Editor -> Templates,这里可以设置(增、删、改、导入等)管理你的模板。新建文件注释、函数注释、代码块等模板的实例新建模板,分别输入Name、Description、Patterna)文件注释Name: 3cfileDescriptio...2013-10-04
  • EXCEL数据上传到SQL SERVER中的简单实现方法

    EXCEL数据上传到SQL SERVER中的方法需要注意到三点!注意点一:要把EXCEL数据上传到SQL SERVER中必须提前把EXCEL传到服务器上.做法: 在ASP.NET环境中,添加一个FileUpload上传控件后台代码的E.X: 复制代码 代码如下: if...2013-09-23
  • mysql锁定单个表的方法

    mysql锁定单个表的方法 复制代码 代码如下:mysql>lock table userstat read; mysql>unlock tables; 页级的典型代表引擎为BDB。 表级的典型代表引擎为MyISAM,MEMORY以及很久以前的ISAM。 行级的典型代表引擎为INN...2014-05-31