在NT系列OS中模块化安装PHP

在NT系列OS中模块化安装PHP 经常看有朋友问关于安装的问题.今天就来详细的谈谈~~:)

几年以前我用WIN98+PWS+PHP 4.0.2用的挺好.后来升级到Windows 2000.用IIS Server,
后来才知道IIS中是以CGI方式运行的.不过IIS配置简单.做开发测试也够了.

现在偶用的OS是Windows Server 2003.下面的文章是介绍用Apache 2模块化安装PHP.

这种安装方式的优点大家还是看小弟的文章吧.~~BTW:昨天刚从南京回来.上次的文章(走向PHP高手之路<2>)过几天再贴上来.先谢谢斑竹大哥将拙作置顶.
小弟很感激~~偶会继续努力的~~呵呵~~在Windows 2000/XP/Windows Server 2003系统中使用Apache服务器模块化安装 PHP

标 题:在Windows 2000/XP系统中使用Apache服务器模块化安装 PHP参 考:

Wrox Press 关键字:PHP 模块化安装 APACHE在各种网络编程语言中。PHP以其简单易学、功能强大吸引了众多编程爱好者。然而PHP的安装却成为许多初学者面前的拦路虎。

下面我来给大家较为详细的介绍一种在微软Windows 2000/XP平台下以模块化方式安装PHP及常用模块的方法。
基础知识在介绍前。请各位先了解一些PHP安装的基础知识。PHP有CGI和模块化两种不同的安装方式。
用CGI方式安装的PHP,在每次解析PHP脚本时,服务器都会产生一个临时的PHP解析器(进程)来解析PHP脚本。
当访问量大时.会使Server性能降低。而用模块化安装的PHP,它和Apache服务器运行在同一内存地址中。
比CGI方式有相当大的性能提升和更高的安全性。所以模块化安装比CGI方式有着更大的优越性。
相关软件Apache服务器采用2.0.43系列版本。

下载地址:http://www.apache.org/PHP采用较新具有良好安全性和稳定性的4.32版,支持模块化方式安装。

请注意下载时选择ZIP版本。下载地址:http://www.php.net/安装Apache 服务器当相关软件都准备好后。
先安装Apache 2.0.43,在安装的时候。默认的安装路径是C:的开始菜单,建议把路径改为c盘根目录。
这样在日常使用时会方便些。Apache安装好后。注意任务栏系统托盘区会出现一个红色羽毛的标志。
如果羽毛下方是绿色的三角形。表示Apache安装成功正在运行。如果出现一个红色的停止标志。
则表示安装过程中出现了问题。一般是端口有冲突。如果你的机器上另外安装有IIS之类服务器的话。
请检查一下80端口是不是被IIS占用了。如果你想让Apache使用其他的端口。OK。
在开始菜单Apache HTTP Server 2.0.43项目的
Configure Apache Server里选择Edit the Apache httpd.conf Configuration File,
打开后(建议安装使用UltraEdit之类带行号显示的文本编辑器),在120行左右有Listen 80字样。
表示Apache默认使用的是80端口。你可以修改成你想要的端口。只要在浏览时加上你修改的端口号就可以了。
如http://localhost(:端口号)/index.html.en ,这是Apache的起始页。模块化安装PHP安装好Apache后。
最重要的一步开始了。将下载后的PHP4.32解压到C盘根目录。
一般默认的文件夹名应该是php-4.3.2-Win32 这种格式,将其改为php。
再把其中php.ini-dist文件改为php.ini,把这个文件复制到C:WINNT(2000)或C:WINDOWS(XP)目录中,
这里有一个小知识,如果系统目录和PHP目录同时有php.ini配置文件的话,PHP会优先执行PHP目录中的那个!
这也是很多朋友在日常使用PHP时经常遇到的问题。修改了系统目录中的php.ini,但运行后却没有实现想要的结果。
原因就在这里!下面是最重要的一步。再度打开Apache的配置文件httpd.conf ,在172行左右。
会发现类似#LoadModule ssl_module modules/mod_ssl.so 的语句,LoadModule表示加载模块。
同样,我们可以配置Apache加载PHP模块,以实现PHP的模块化安装。
在173行我们添上 LoadModule php4_module C:/php/sapi/php4apache2.dll 语句。
用来调用PHP的Apache模块。后面的路径随着你机器中PHP的安装路径而改变。
最后,在354行,我们添加上 AddType application/x-httpd-php .php .html 语句,
表示Apache解析文件的扩展名。最后。把PHP文件夹中的php4ts.dll 文件复制到系统目录的SYSTEM32文件夹。
重启Apache.图片如下: OK,你是否在Apache Server Monitor下方的状态栏中
(在任务栏系统托盘的羽毛标志上右击)看到了Apache/2.0.43 (Win32) PHP/4.3.2 的标志?如果看到了。
说明PHP模块化安装成功!如果没有看到也没有关系,照上面的步骤检查一遍,看看有没有什么地方疏漏了。
新建一个文件写入 ,保存到Apache安装目录的htdocs文件夹后在IE中打开,
在显示的系统信息第三行Server API中应该可以发现 Apache 2.0 Handler ,
表示PHP是以模块化安装。自此,PHP的安装告一段落。图片如下:
安装常用模块在日常PHP程序开发过程中,我们经常会用到一些模块。比如用来处理图像的GD模块,
用来加密的MD5模块等等。那么这些模块是怎么加载到PHP中的呢?
下面我们就以GD模块的安装为例来给大家介绍一下PHP中各模块的安装方法。
用文本编辑器打开php.ini配置文件。会在428行左右发现 extension_dir = “./” 这是常用扩展模块的路径。
你可以不改。为了下面实现GD库的安装,我们这里改为
extension_dir = c:/php/extensions/ 表示PHP的扩展文件所在路径。
修改好后。找到546行。会发现很多 ;extension=php_gd2.dll 之类的语句。
各种.dll文件表示PHP可以加载的各类模块,默认是屏蔽的,我们将546行extension之前的分号去掉,
表示去掉屏蔽。修改好之后,保存到系统文件夹中(别忘了还有PHP文件夹)。重启Apache服务器,
执行上面我们看PHP基本信息的PHP文件,会在Configuration项目的表格中发现路径
extension_dir | c:/php/extensions/ 然后会在下面发现一个GD的表格,说明GD安装成功!
其他各类模块的安装和GD模块安装类似,各位可根据自己需要分别加载。别忘了修改完文件后重启Apache服务器。
否则看不到结果。PHP在构建中小型项目中有很多优势。但其安装却相对复杂,
很多PHP爱好者喜欢用网上一些集成安装包一次安装,但笔者不建议使用安装包,这样不利于理解PHP中的一些概念。
而且日后加载各模块还是要自己动手。本文较为详细的介绍了PHP的最优安装和模块的加载。
希望能帮助各位初学者迈出学习WEB开发技术的第一步。

COPYRIGHT 2003(C) CHUMMY WU配图说明:1.偶机器上配置好的Apache Server2.偶机器上PHP基本信息.
机器是Intel Celeron 1G/256MB/40G 7200rpm/,OS是Windows Server 2003,另外由于开发需要.安装了
Zend Optimizer与Zend Encoder加密程序.这样再图上显示的就多了些内容.

DEBUG使用

(1)在DOS提示符下,键人命令

C:/>DEBUG [盘符][ 路径][文件名[.扩展名]] ↙

(2)先运行DEBUG程序, 在DEBUG状态下用N和L命令装入

C:/>DEBUG ↙

—N 文件名 ↙

—L ↙
例: C>DEBUG A:EX_MOVE.EXE ↙

或:C>DEBUG ↙

-N A:EX_MOVE.EXE ↙

-L ↙

DEBUG命令的一般规则

(1) DEBUG提示符——破折号(—)

(2) 在DEBUG命令中使用的地址格式约定:

[<段地址>:]<位移量>

其中<段地址>可以是段寄存器名,也可以是十六进制的值,也可以缺省。

例:CS:100 0914:100

地址范围的格式为:

<段地址>:<始位移量> <末位移量>

或:<段地址>:<始位移量> L <长度>

例:CS:100 110 0914:100 L10

(3) 命令与参数之间的分隔符(空格或逗号)可有可无,但两个十六进制之间必须要有分隔符。因此,下列三个命令是等价的:

DCS:100 100 ;命令D与参数之间无分隔符

D CS:100 100 ;命令D与参数之间有分隔符空格

D,CS:100,100 ;命令D与参数之间有分隔符逗号

(1) 显示内存储单元的内容

格式1:D <地址>

格式2:D <地址范围>

格式3:D

格式1,从指定偏移量开始显示128(80H)个字节内容;格式2,显示指定范围内存单元的内容;格式3,从当前位移量开始,显示128(80H)个内存单元内容。除非显示指定,D命令默认数据段。
例: —D 100 ↙

(2) 修改内存储单元的内容

①输入命令E(Enter)

格式1:E <地址> <字节串>

格式2:E <地址>

格式1 可以用给定的内容表来替代指定范围的存储单元内容。

例如,一EDS:100 F3’XYZ’8D

格式2则是采用逐个单元相继修改的方法。从指定地址开始,逐一显示内存单元的内容,若需修改,可以直接输入要修改的内容; 如不需修改,可以按”空格”键跳过;直到按回车键结束.

例如,一EDS:100

②填写命令F(Fill)

格式:F <地址范围> <要填入的字节或字节串>

如果<要填入的字节或字节串>的字节数超过指定的范围,则多余的不计.如果<要填入的字节或字节串>的字节数小于指定的范围,则重复使用<要填入的字节或字节串>填入,直到填满指定的所有单元为止。

例如:一f 4BA:100 L 5F3’XYZ’8D

或: 一f 4BA:100 104 5F3’XYZ’8D

显示和修改寄存器内容R(Register)

格式1:R

格式2:R 寄存器名

格式3:RF

格式1显示CPU内所有寄存器内容和标志位状态;格式2显示和修改指定的寄存器内容;格式3显示和修改标志位状态。

例如:一R

一RCX

一RF

运行命令G(Go)

格式1:G

格式2:G =<始址>

格式3:G=<始址> <断点>

格式1从当前的CS:IP开始运行;格式2从指定的地址开始运行;格式3当指令执行到断点时.就停止执行并显示当前所有寄存器及标志位的内容,和下一条将要执行的指令。

例如:一 G

一G=110

一G=110 130

跟踪命令T(Trace)

格式1:T

格式2:T =<始址>

格式3:T=<始址> <跟踪条数>
格式1从当前的CS:IP开始跟踪,每次跟踪1条指令,系统就暂停,并显示当前寄存器值和下一条要执行的指令;格式2从指定的地址开始跟踪;格式3从指定的地址开始跟踪,执行指定条数后就停止执行并显示当前所有寄存器及标志位的内容,和下一条将要执行的指令

汇编命令 A(Assemble)

格式1:A

格式2:A <始址>

汇编命令将输入的汇编语言语句,汇编成机器代码,相继地存放在从指定地址开始的存储区

反汇编命令 U(Unassemble)

格式1:U

格式2:U <始址>

格式3:U <范围>

格式1从上一个U命令的最后一条指令的下一个单元开始,反汇编址32个字节;格式2从指定的地址开始,反汇编址32个字节;格式3反汇编指定范围内的字节。

查找S

格式:S〈范围〉〈字符串〉

在指定的范围中,查找指定的字符串。

例如:一S 0000 FFFE ‘ABC’

命名命令N (Name)

格式:N〈文件名〉

装入命令L(Load)

格式1:L [〈地址〉]

格式2:L[〈地址〉] [〈盘号:〉〈逻辑扇区号〉〈扇区数〉]

格式1将用命名命令N命名的文件的内容装入指定的内存区域;格式2将磁盘扇区的内容装入指定的内存区域。其中盘号0是A盘,1是B盘,2是C盘。当没有指定地址,则将信息装入CS:0100H处。

例:装入B盘中的Q1.COM文件

一N B:Q1.COM

一L

例:装入A盘中的DOS引导纪录

一L 100 0 0 1

写命令W(Write)

格式1:W [〈地址〉]

格式2:W[〈地址〉] [〈盘号:〉〈逻辑扇区号〉〈扇区数〉]

格式1从指定的内存区域将由CX寄存器指定的字节数写入用命名命令N命名的文件中;格式2从指定的内存区域将指定的扇区数写入指定的磁盘和扇区中。当没有指定地址,则从CS:0100H处开始写入。

例:将内存CS:100H处的1个扇区,装入A盘中的DOS引导记录(DOS引导记录在0磁道1扇区)

一W 100 0 0 1

退出DEBEG命令Q(Quit)

; program title goes head—
;
;EQU STATEMENT GO HEAD—
; *************
STACK SEGMENT PARA STACK ‘STACK’
DB 20 DUP(‘STACK ‘)
STACK ENDS
;********************
DATASG SEGMENT
; DATA GOES HEAR
DATASG ENDS
; *********************
EXTRA SEGMENT
; DATA GOES HEAR
EXTRA ENDS
; *********************
CODESG SEGMENT
;———————-
MAIN PROC FAR
ASSUME CS:CODESG,DS:DATASG,ES:EXTRA,SS:STACK
PUSH DS
MOV AX,0
PUSH AX
MOV AX,DATASG
MOV DS,AX
MOV AX,EXTRA
MOV ES,AX
; MAIN PART OF PROGRAM GOES HEAR
RET
MAIN ENDP
;———————–
CODESG ENDS
;**************************
END MAIN

JScript 教学笔记

JScript 是 Microsoft 公司对 ECMA 262 语言规范(ECMAScript 编辑器 3)的一种实现。除了少数例外(为了保持向后兼容),JScript 完全实现了 ECMA 标准。本概述的目的就是引导您学习使用 JScript。
使用 JScript

JScript 是一种解释型的、基于对象的脚本语言。尽管与 C++ 这样成熟的面向对象的语言相比,JScript 的功能要弱一些,但对于它的预期用途而言,JScript 的功能已经足够大了。

JScript 不是其他语言的精简版(例如,它只是与 Java 有点模糊而间接的关系),也不是任何事物的简化。不过,它有其局限性。例如,您不能使用该语言来编写独立运行的应用程序,并且没有对读写文件的内置支持。此外,JScript 脚本只能在某个解释器或“宿主”上运行,如 Active Server Pages(ASP)、Internet 浏览器或者 Windows 脚本宿主。

JScript 是一种宽松类型的语言。宽松类型意味着您不必显式定义变量的数据类型。事实上 JScript 更进一步。您无法在JScriot上明确地定义数据类型。此外,在大多数情况下,JScript 将根据需要自动进行转换。例如,如果将一个数值添加到由文本组成的某项(一个字符串),该数值将被转换为文本。

ECMA 標準(日本語訳)
ECMA-262

ECMA(European Computer Manufacturers Association)的ECMAScript标准
過去の概要

この ECMA 標準はいくつかの元の技術に基づいていて,もっともよく知られているのは JavaScript(Netscape 社)とJScript(Microsoft 社)である。その言語は Netscape 社で Brendan Eich により発明され,この会社の Navigator 2.0 ブラウザで最初に現れた。それは Netscape 社による全てのそれ以降のブラウザと Internet Explorer 3.0 から始まる Microsoft 社による全てのブラウザに現れている。

この標準の開発は 1996 年 11 月から始まった。この ECMA 標準の第 1 版は 1997 年 1 月の ECMA 総会で採用された。

ECMA 標準は fast-track 手続き以下の採用のために ISO/IEC JTC 1 に提出された。そして 1998 年 4 月,国際標準 ISO/IEC 16262 として承認された。 1998 年 6 月の ECMA 総会は完全に提携した ISO/IEC 16262 を保つために第 2 版の ECMA-262 を承認した。第 1 版と第 2 版の間の変化は自然な論説である。

現在の文書はその標準の第 3 版で,強力な通常表現を含み,より扱いやすい文字,新しいコントロールステートメント,try/catch 例外の扱い,しっかりしたエラーの定義,numeric 出力のための型,将来予定されている国際取り決めを前もって使う小さな変化および将来の言語の発展を定義する。

この言語の働きは完全ではない。技術委員会は World Wide Web Consortium と Wireless Application Protocol Forum の範囲内のグループのような他の標準団体と一緒にインターネットを交えて作成されて使われているスクリプトと密接な関係のための仕組みを含む重要な向上に取り組んでいる。

この標準は 1999 年 12 月に ECMA 総会で ECMA-262 の第 3 版として採用されている。
以下,未訳。

开关IIS不重启电脑

有时候我们在WEB程序如:ASP,中无意中使用到了一个死循环,或者在测试DLL组件时,挂了。这时候IIS就停止了响应,我们要继续我们的工作啊,重启IIS服务吧。   然而这个进程还在执行,Internet 服务管理器还关闭不了。而当想结束inetinfo.exe 或者 DLLHOST.EXE 进程的时候,我们得到了一个拒绝的信息,当然你是管理员权限也还是得到这样提示。你也可能会用net stop,不过花的时间要长些,而且有时候不响应。   这时我们只有重启电脑了。能不用重启电脑而RESTART IIS么?  当然可以,Microsoft在安装IIS的时候同时安装了一个工具,叫 iisreset,你可以在winntsystem32 中找到它,他可以和PING一样以命令行方式使用。它有多个参数,下面是几个重要的,也是我们本文切题的参数:
/RESTART 停止后启动IIS
/START 启动IIS (如果停止)
/STOP 停止IIS (如果启动)
/REBOOT 重启电脑
/REBOOTONERROR 如果停止IIS失败重启电脑
/NOFORCE 不用强迫IIS停止
/TIMEOUT:X 在X秒后, IIS被强制停止,除非
/NOFORCE 参数给出.如果
/REBOOTONERROR 给出, 它重启电脑.   最方便的使用,当然你也可在CMD下运行:200492214816_20050318094943.gif

正则表达式使用详解

如果我们问那些UNIX系统的爱好者他们最喜欢什么,答案除了稳定的系统和可以远程启动之外,十有八九的人会提到正则表达式;如果我们再问他们最头痛的是什么,可能除了复杂的进程控制和安装过程之外,还会是正则表达式。那么正则表达式到底是什么?如何才能真正的掌握正则表达式并正确的加以灵活运用?本文将就此展开介绍,希望能够对那些渴望了解和掌握正则表达式的读者有所助益。

入门简介
  简单的说,正则表达式是一种可以用于模式匹配和替换的强有力的工具。我们可以在几乎所有的基于UNIX系统的工具中找到正则表达式的身影,例如,vi编辑器,Perl或PHP脚本语言,以及awk或sed shell程序等。此外,象JavaScript这种客户端的脚本语言也提供了对正则表达式的支持。由此可见,正则表达式已经超出了某种语言或某个系统的局限,成为人们广为接受的概念和功能。
  正则表达式可以让用户通过使用一系列的特殊字符构建匹配模式,然后把匹配模式与数据文件、程序输入以及WEB页面的表单输入等目标对象进行比较,根据比较对象中是否包含匹配模式,执行相应的程序。
  举例来说,正则表达式的一个最为普遍的应用就是用于验证用户在线输入的邮件地址的格式是否正确。如果通过正则表达式验证用户邮件地址的格式正确,用户所填写的表单信息将会被正常处理;反之,如果用户输入的邮件地址与正则表达的模式不匹配,将会弹出提示信息,要求用户重新输入正确的邮件地址。由此可见正则表达式在WEB应用的逻辑判断中具有举足轻重的作用。

基本语法
  在对正则表达式的功能和作用有了初步的了解之后,我们就来具体看一下正则表达式的语法格式。
  正则表达式的形式一般如下:
  /love/
  其中位于“/”定界符之间的部分就是将要在目标对象中进行匹配的模式。用户只要把希望查找匹配对象的模式内容放入“/”定界符之间即可。为了能够使用户更加灵活的定制模式内容,正则表达式提供了专门的“元字符”。所谓元字符就是指那些在正则表达式中具有特殊意义的专用字符,可以用来规定其前导字符(即位于元字符前面的字符)在目标对象中的出现模式。
  较为常用的元字符包括: “+”, “*”,以及 “?”。其中,“+”元字符规定其前导字符必须在目标对象中连续出现一次或多次,“*”元字符规定其前导字符必须在目标对象中出现零次或连续多次,而“?”元字符规定其前导对象必须在目标对象中连续出现零次或一次。
  下面,就让我们来看一下正则表达式元字符的具体应用。
  /fo+/
  因为上述正则表达式中包含“+”元字符,表示可以与目标对象中的 “fool”, “fo”, 或者 “football”等在字母f后面连续出现一个或多个字母o的字符串相匹配。
  /eg*/
  因为上述正则表达式中包含“*”元字符,表示可以与目标对象中的 “easy”, “ego”, 或者 “egg”等在字母e后面连续出现零个或多个字母g的字符串相匹配。
  /Wil?/
  因为上述正则表达式中包含“?”元字符,表示可以与目标对象中的 “Win”, 或者 “Wilson”,等在字母i后面连续出现零个或一个字母l的字符串相匹配。
  除了元字符之外,用户还可以精确指定模式在匹配对象中出现的频率。例如,
  /jim{2,6}/
  上述正则表达式规定字符m可以在匹配对象中连续出现2-6次,因此,上述正则表达式可以同jimmy或jimmmmmy等字符串相匹配。
  在对如何使用正则表达式有了初步了解之后,我们来看一下其它几个重要的元字符的使用方式。
  s:用于匹配单个空格符,包括tab键和换行符;
  S:用于匹配除单个空格符之外的所有字符;
  d:用于匹配从0到9的数字;
  w:用于匹配字母,数字或下划线字符;
  W:用于匹配所有与w不匹配的字符;
  . :用于匹配除换行符之外的所有字符。
  (说明:我们可以把s和S以及w和W看作互为逆运算)
  下面,我们就通过实例看一下如何在正则表达式中使用上述元字符。
  /s+/
  上述正则表达式可以用于匹配目标对象中的一个或多个空格字符。
  /d000/
  如果我们手中有一份复杂的财务报表,那么我们可以通过上述正则表达式轻而易举的查找到所有总额达千元的款项。
  除了我们以上所介绍的元字符之外,正则表达式中还具有另外一种较为独特的专用字符,即定位符。定位符用于规定匹配模式在目标对象中的出现位置。
  较为常用的定位符包括: “^”, “$”, “b” 以及 “B”。其中,“^”定位符规定匹配模式必须出现在目标字符串的开头,“$”定位符规定匹配模式必须出现在目标对象的结尾,b定位符规定匹配模式必须出现在目标字符串的开头或结尾的两个边界之一,而“B”定位符则规定匹配对象必须位于目标字符串的开头和结尾两个边界之内,即匹配对象既不能作为目标字符串的开头,也不能作为目标字符串的结尾。同样,我们也可以把“^”和“$”以及“b”和“B”看作是互为逆运算的两组定位符。举例来说:
  /^hell/
  因为上述正则表达式中包含“^”定位符,所以可以与目标对象中以 “hell”, “hello”或 “hellhound”开头的字符串相匹配。
  /ar$/
  因为上述正则表达式中包含“$”定位符,所以可以与目标对象中以 “car”, “bar”或 “ar” 结尾的字符串相匹配。
  /bbom/
  因为上述正则表达式模式以“b”定位符开头,所以可以与目标对象中以 “bomb”, 或 “bom”开头的字符串相匹配。
  /manb/
  因为上述正则表达式模式以“b”定位符结尾,所以可以与目标对象中以 “human”, “woman”或 “man”结尾的字符串相匹配。
  为了能够方便用户更加灵活的设定匹配模式,正则表达式允许使用者在匹配模式中指定某一个范围而不局限于具体的字符。例如:
  /[A-Z]/
  上述正则表达式将会与从A到Z范围内任何一个大写字母相匹配。
  /[a-z]/
  上述正则表达式将会与从a到z范围内任何一个小写字母相匹配。
  /[0-9]/
  上述正则表达式将会与从0到9范围内任何一个数字相匹配。
  /([a-z][A-Z][0-9])+/
  上述正则表达式将会与任何由字母和数字组成的字符串,如 “aB0” 等相匹配。这里需要提醒用户注意的一点就是可以在正则表达式中使用 “()” 把字符串组合在一起。“()”符号包含的内容必须同时出现在目标对象中。因此,上述正则表达式将无法与诸如 “abc”等的字符串匹配,因为“abc”中的最后一个字符为字母而非数字。
  如果我们希望在正则表达式中实现类似编程逻辑中的“或”运算,在多个不同的模式中任选一个进行匹配的话,可以使用管道符 “|”。例如:
  /to|too|2/
  上述正则表达式将会与目标对象中的 “to”, “too”, 或 “2” 相匹配。
  正则表达式中还有一个较为常用的运算符,即否定符 “[^]”。与我们前文所介绍的定位符 “^” 不同,否定符 “[^]”规定目标对象中不能存在模式中所规定的字符串。例如:
  /[^A-C]/
  上述字符串将会与目标对象中除A,B,和C之外的任何字符相匹配。一般来说,当“^”出现在 “[]”内时就被视做否定运算符;而当“^”位于“[]”之外,或没有“[]”时,则应当被视做定位符。
  最后,当用户需要在正则表达式的模式中加入元字符,并查找其匹配对象时,可以使用转义符“”。例如:
  /Th*/
  上述正则表达式将会与目标对象中的“Th*”而非“The”等相匹配。

<!– start hiding
    
function verifyAddress(obj)
     
{
      
var email = obj.email.value;
      
var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
      
flag = pattern.test(email);
      
if(flag)
      
{
       
alert(“Your email address is correct!”);
       
return true;
      
}
      
else
       
{
        
alert(“Please try again!”);
        
return false;
       
}
     
}
    
// stop hiding –>
   
</script>
   
</head>
  
<body>
  
<form onSubmit="return verifyAddress(this);">
   
<input name="email" type="text">
   
<input type="submit">
   
</form>
  
</body>
 
</html>

关键字:正则表达式 模式匹配 Javascript

摘要:收集一些常用的正则表达式。

正则表达式用于字符串处理,表单验证等场合,实用高效,但用到时总是不太把握,以致往往要上网查一番。我将一些常用的表达式收藏在这里,作备忘之用。本贴随时会更新。

匹配中文字符的正则表达式: [u4e00-u9fa5]

匹配双字节字符(包括汉字在内):[^x00-xff]

应用:计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)

String.prototype.len=function(){return this.replace([^x00-xff]/g,”aa”).length;}

匹配空行的正则表达式: [s| ]*

匹配HTML标记的正则表达式:/<(.*)>.*|<(.*) />/

匹配首尾空格的正则表达式:(^s*)|(s*$)

应用:javascript中没有像vbscript那样的trim函数,我们就可以利用这个表达式来实现,如下:

String.prototype.trim = function()
{
return this.replace(/(^s*)|(s*$)/g, “”);
}

利用正则表达式分解和转换IP地址:

下面是利用正则表达式匹配IP地址,并将IP地址转换成对应数值的Javascript程序:

function IP2V(ip)
{
re=/(d+).(d+).(d+).(d+)/g //匹配IP地址的正则表达式
if(re.test(ip))
{
return RegExp.$1*Math.pow(255,3))+RegExp.$2*Math.pow(255,2))+RegExp.$3*255+RegExp.$4*1
}
else
{
throw new Error(“Not a valid IP address!”)
}
}

不过上面的程序如果不用正则表达式,而直接用split函数来分解可能更简单,程序如下:

var ip=”10.100.20.168″
ip=ip.split(“.”)
alert(“IP值是:”+(ip[0]*255*255*255+ip[1]*255*255+ip[2]*255+ip[3]*1))

匹配Email地址的正则表达式:w+([-+.]w+)[email protected]+([-.]w+)*.w+([-.]w+)*

匹配网址URL的正则表达式:http://([w-]+.)+[w-]+(/[w- ./?%&=]*)?

利用正则表达式去除字串中重复的字符的算法程序:[注:此程序不正确,原因见本贴回复]

var s=”abacabefgeeii”
var s1=s.replace(/(.).*1/g,”$1″)
var re=new RegExp(“[“+s1+”]”,”g”)
var s2=s.replace(re,””)
alert(s1+s2) //结果为:abcefgi

我原来在CSDN上发贴寻求一个表达式来实现去除重复字符的方法,最终没有找到,这是我能想到的最简单的实现方法。思路是使用后向引用取出包括重复的字符,再以重复的字符建立第二个表达式,取到不重复的字符,两者串连。这个方法对于字符顺序有要求的字符串可能不适用。

得用正则表达式从URL地址中提取文件名的javascript程序,如下结果为page1

s=”http://www.9499.net/page1.htm”
s=s.replace(/(.*/){0,}([^.]+).*/ig,”$2″)
alert(s)

利用正则表达式限制网页表单里的文本框输入内容:

用正则表达式限制只能输入中文:onkeyup=”value=value.replace(/[^u4E00-u9FA5]/g,”)” onbeforepaste=”clipboardData.setData(‘text’,clipboardData.getData(‘text’).replace(/[^u4E00-u9FA5]/g,”))”

用正则表达式限制只能输入全角字符: onkeyup=”value=value.replace(/[^uFF00-uFFFF]/g,”)” onbeforepaste=”clipboardData.setData(‘text’,clipboardData.getData(‘text’).replace(/[^uFF00-uFFFF]/g,”))”

用正则表达式限制只能输入数字:onkeyup=”value=value.replace(/[^d]/g,”) “onbeforepaste=”clipboardData.setData(‘text’,clipboardData.getData(‘text’).replace(/[^d]/g,”))”

用正则表达式限制只能输入数字和英文:onkeyup=”value=value.replace(/[W]/g,”) “onbeforepaste=”clipboardData.setData(‘text’,clipboardData.getData(‘text’).replace(/[^d]/g,”))”

MVC-MODEL VIEW CONTROL

MVC是MODEL_VIEW_CONTROL的缩写。MODEL_VIEW_CONTROL是软件设计的典型结构。在这种设计结构下,一个应用被分为三个部分:model,view和controller,每个部分负责不同的功能。model是指应用程序的数据,以及对这些数据的操作;view是指用户界面;controller负责用户界面和程序数据之间的同步,也就是完成两个方向的动作:一、在根据用户界面(view)的操作完成对程序数据 (model)的更新,二、将程序数据(model)的改变及时反应到用户界面(view)上。

JAVA中的MVC
JAVA把MVC引入了Web领域,并在此基础上架构出了一套称为Model2的体系。由于Web的特殊性,JAVA中的MVC和Desktop中的MVC并不完全一致。主要原因是Web中的V不是持续的,用户每访问一次,V就要重新生成一次,所以V始终是和M一致的,不需要C来控制同步。那么JAVA中的C在干什么?JAVA中的C通常用于流程的转向,其实用的是Dispatch模式,不再是Desktop中的C了。

引文至此 昨天得mickey介绍一下再找了一下 文章多是java技术传过来PHP的概念,但已有一定发展了….

PHP中的MVC引文
http://www.phpe.net/articles/343.shtml -phpe.net
http://www-900.ibm.com/developerWorks/cn/linux/sdk/php/pear5/index.shtml -ibm developerWorks 中国网站 (不错)

php.ini 设置手记

>_<成日唔记得设咩 记低先 register_globals = On extension_dir = "C:phpextensions" extension=php_gd2.dll extension=php_mbstring.dll extension=php_sockets.dll default_socket_timeout = 600 mbstring.language = zh-cn mbstring.internal_encoding = zh-cn mbstring.http_input = auto mbstring.http_output = big5 ============================全 文============================== [PHP] ;;;;;;;;;;; ; WARNING ; ;;;;;;;;;;; ; This is the default settings file for new PHP installations. ; By default, PHP installs itself with a configuration suitable for ; development purposes, and *NOT* for production purposes. ; For several security-oriented considerations that should be taken ; before going online with your site, please consult php.ini-recommended ; and http://php.net/manual/en/security.php. ;;;;;;;;;;;;;;;;;;; ; About this file ; ;;;;;;;;;;;;;;;;;;; ; This file controls many aspects of PHP's behavior. In order for PHP to ; read it, it must be named 'php.ini'. PHP looks for it in the current ; working directory, in the path designated by the environment variable ; PHPRC, and in the path that was defined in compile time (in that order). ; Under Windows, the compile-time path is the Windows directory. The ; path in which the php.ini file is looked for can be overridden using ; the -c argument in command line mode. ; ; The syntax of the file is extremely simple. Whitespace and Lines ; beginning with a semicolon are silently ignored (as you probably guessed). ; Section headers (e.g. [Foo]) are also silently ignored, even though ; they might mean something in the future. ; ; Directives are specified using the following syntax: ; directive = value ; Directive names are *case sensitive* - foo=bar is different from FOO=bar. ; ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression ; (e.g. E_ALL & ~E_NOTICE), or a quoted string ("foo"). ; ; Expressions in the INI file are limited to bitwise operators and parentheses: ; | bitwise OR ; & bitwise AND ; ~ bitwise NOT ; ! boolean NOT ; ; Boolean flags can be turned on using the values 1, On, True or Yes. ; They can be turned off using the values 0, Off, False or No. ; ; An empty string can be denoted by simply not writing anything after the equal ; sign, or by using the None keyword: ; ; foo = ; sets foo to an empty string ; foo = none ; sets foo to an empty string ; foo = "none" ; sets foo to the string 'none' ; ; If you use constants in your value, and these constants belong to a ; dynamically loaded extension (either a PHP extension or a Zend extension), ; you may only use these constants *after* the line that loads the extension. ; ; All the values in the php.ini-dist file correspond to the builtin ; defaults (that is, if no php.ini is used, or if you delete these lines, ; the builtin defaults will be identical). ;;;;;;;;;;;;;;;;;;;; ; Language Options ; ;;;;;;;;;;;;;;;;;;;; ; Enable the PHP scripting language engine under Apache. engine = On ; Allow the tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = On

; Allow ASP-style <% %> tags.
asp_tags = Off

; The number of significant digits displayed in floating point numbers.
precision = 12

; Enforce year 2000 compliance (will cause problems with non-compliant browsers)
y2k_compliance = On

; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP’s output layer a
; bit. You can enable output buffering during runtime by calling the output
; buffering functions. You can also enable output buffering for all files by
; setting this directive to On. If you wish to limit the size of the buffer
; to a certain size – you can use a maximum number of bytes instead of ‘On’, as
; a value for this directive (e.g., output_buffering=4096).
output_buffering = Off

; You can redirect all of the output of your scripts to a function. For
; example, if you set output_handler to “mb_output_handler”, character
; encoding will be transparently converted to the specified encoding.
; Setting any output handler automatically turns on output buffering.
; Note: People who wrote portable scripts should not depend on this ini
; directive. Instead, explicitly set the output handler using ob_start().
; Using this ini directive may cause problems unless you know what script
; is doing.
; Note: You cannot use both “mb_output_handler” with “ob_iconv_handler”
; and you cannot use both “ob_gzhandler” and “zlib.output_compression”.
;output_handler =

; Transparent output compression using the zlib library
; Valid values for this option are ‘off’, ‘on’, or a specific buffer size
; to be used for compression (default is 4KB)
; Note: Resulting chunk size may vary due to nature of compression. PHP
; outputs chunks that are few hundreds bytes each as a result of
; compression. If you prefer a larger chunk size for better
; performance, enable output_buffering in addition.
; Note: You need to use zlib.output_handler instead of the standard
; output_handler, or otherwise the output will be corrupted.
zlib.output_compression = Off

; You cannot specify additional output handlers if zlib.output_compression
; is activated here. This setting does the same as output_handler but in
; a different order.
;zlib.output_handler =

; Implicit flush tells PHP to tell the output layer to flush itself
; automatically after every output block. This is equivalent to calling the
; PHP function flush() after each and every call to print() or echo() and each
; and every HTML block. Turning this option on has serious performance
; implications and is generally recommended for debugging purposes only.
implicit_flush = Off

; The unserialize callback function will called (with the undefind class’
; name as parameter), if the unserializer finds an undefined class
; which should be instanciated.
; A warning appears if the specified function is not defined, or if the
; function doesn’t include/implement the missing class.
; So only set this entry, if you really want to implement such a
; callback-function.
unserialize_callback_func=

; When floats & doubles are serialized store serialize_precision significant
; digits after the floating point. The default value ensures that when floats
; are decoded with unserialize, the data will remain the same.
serialize_precision = 100

; Whether to enable the ability to force arguments to be passed by reference
; at function call time. This method is deprecated and is likely to be
; unsupported in future versions of PHP/Zend. The encouraged method of
; specifying which arguments should be passed by reference is in the function
; declaration. You’re encouraged to try and turn this option Off and make
; sure your scripts work properly with it in order to ensure they will work
; with future versions of the language (you will receive a warning each time
; you use this feature, and the argument will be passed by value instead of by
; reference).
allow_call_time_pass_reference = On

; Safe Mode
;
safe_mode = Off

; By default, Safe Mode does a UID compare check when
; opening files. If you want to relax this to a GID compare,
; then turn on safe_mode_gid.
safe_mode_gid = Off

; When safe_mode is on, UID/GID checks are bypassed when
; including files from this directory and its subdirectories.
; (directory must also be in include_path or full path must
; be used when including)
safe_mode_include_dir =

; When safe_mode is on, only executables located in the safe_mode_exec_dir
; will be allowed to be executed via the exec family of functions.
safe_mode_exec_dir =

; Setting certain environment variables may be a potential security breach.
; This directive contains a comma-delimited list of prefixes. In Safe Mode,
; the user may only alter environment variables whose names begin with the
; prefixes supplied here. By default, users will only be able to set
; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).
;
; Note: If this directive is empty, PHP will let the user modify ANY
; environment variable!
safe_mode_allowed_env_vars = PHP_

; This directive contains a comma-delimited list of environment variables that
; the end user won’t be able to change using putenv(). These variables will be
; protected even if safe_mode_allowed_env_vars is set to allow to change them.
safe_mode_protected_env_vars = LD_LIBRARY_PATH

; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
;open_basedir =

; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
disable_functions =

; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
disable_classes =

; Colors for Syntax Highlighting mode. Anything that’s acceptable in
; would work.
;highlight.string = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.bg = #FFFFFF
;highlight.default = #0000BB
;highlight.html = #000000

;
; Misc
;
; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header). It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
expose_php = On

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30000 ; Maximum execution time of each script, in seconds
max_input_time = 600000 ; Maximum amount of time each script may spend parsing request data
memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; error_reporting is a bit-field. Or each number up to get desired error
; reporting level
; E_ALL – All errors and warnings
; E_ERROR – fatal run-time errors
; E_WARNING – run-time warnings (non-fatal errors)
; E_PARSE – compile-time parse errors
; E_NOTICE – run-time notices (these are warnings which often result
; from a bug in your code, but it’s possible that it was
; intentional (e.g., using an uninitialized variable and
; relying on the fact it’s automatically initialized to an
; empty string)
; E_CORE_ERROR – fatal errors that occur during PHP’s initial startup
; E_CORE_WARNING – warnings (non-fatal errors) that occur during PHP’s
; initial startup
; E_COMPILE_ERROR – fatal compile-time errors
; E_COMPILE_WARNING – compile-time warnings (non-fatal errors)
; E_USER_ERROR – user-generated error message
; E_USER_WARNING – user-generated warning message
; E_USER_NOTICE – user-generated notice message
;
; Examples:
;
; – Show all errors, except for notices
;
;error_reporting = E_ALL & ~E_NOTICE
;
; – Show only errors
;
;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
;
; – Show all errors except for notices
;
error_reporting = E_ALL & ~E_NOTICE

; Print out errors (as a part of the output). For production web sites,
; you’re strongly encouraged to turn this feature off, and use error logging
; instead (see below). Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = On

; Even when display_errors is on, errors that occur during PHP’s startup
; sequence are not displayed. It’s strongly recommended to keep
; display_startup_errors off, except for when debugging.
display_startup_errors = Off

; Log errors into a log file (server-specific log, stderr, or error_log (below))
; As stated above, you’re strongly advised to use error logging in place of
; error displaying on production web sites.
log_errors = Off

; Set maximum length of log_errors. In error_log information about the source is
; added. The default is 1024 and 0 allows to not apply any maximum length at all.
log_errors_max_len = 1024

; Do not log repeated messages. Repeated errors must occur in same file on same
; line until ignore_repeated_source is set true.
ignore_repeated_errors = Off

; Ignore source of message when ignoring repeated messages. When this setting
; is On you will not log errors with repeated messages from different files or
; sourcelines.
ignore_repeated_source = Off

; If this parameter is set to Off, then memory leaks will not be shown (on
; stdout or in the log). This has only effect in a debug compile, and if
; error reporting includes E_WARNING in the allowed list
report_memleaks = On

; Store the last error/warning message in $php_errormsg (boolean).
track_errors = Off

; Disable the inclusion of HTML tags in error messages.
;html_errors = Off

; If html_errors is set On PHP produces clickable error messages that direct
; to a page describing the error or function causing the error in detail.
; You can download a copy of the PHP manual from http://www.php.net/docs.php
; and change docref_root to the base URL of your local copy including the
; leading ‘/’. You must also specify the file extension being used including
; the dot.
;docref_root = “/phpmanual/”
;docref_ext = .html

; String to output before an error message.
;error_prepend_string = “

; String to output after an error message.
;error_append_string = “

; Log errors to specified file.
;error_log = filename

; Log errors to syslog (Event Log on NT, not valid in Windows 95).
;error_log = syslog

;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
;
; Note – track_vars is ALWAYS enabled as of PHP 4.0.3

; The separator used in PHP generated URLs to separate arguments.
; Default is “&”.
;arg_separator.output = “&”

; List of separator(s) used by PHP to parse input URLs into variables.
; Default is “&”.
; NOTE: Every character in this directive is considered as separator!
;arg_separator.input = “;&”

; This directive describes the order in which PHP registers GET, POST, Cookie,
; Environment and Built-in variables (G, P, C, E & S respectively, often
; referred to as EGPCS or GPC). Registration is done from left to right, newer
; values override older values.
variables_order = “EGPCS”

; Whether or not to register the EGPCS variables as global variables. You may
; want to turn this off if you don’t want to clutter your scripts’ global scope
; with user data. This makes most sense when coupled with track_vars – in which
; case you can access all of the GPC variables through the $HTTP_*_VARS[],
; variables.
;
; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = On

; This directive tells PHP whether to declare the argv&argc variables (that
; would contain the GET information). If you don’t use these variables, you
; should turn it off for increased performance.
register_argc_argv = On

; Maximum size of POST data that PHP will accept.
post_max_size = 8M

; This directive is deprecated. Use variables_order instead.
gpc_order = “GPC”

; Magic quotes
;

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = On

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ‘ with ” instead of \’).
magic_quotes_sybase = Off

; Automatically add files before or after any PHP document.
auto_prepend_file =
auto_append_file =

; As of 4.0b4, PHP always outputs a character encoding by default in
; the Content-type: header. To disable sending of the charset, simply
; set it to be empty.
;
; PHP’s built-in default is text/html
default_mimetype = “text/html”
default_charset = “zh-cn”

; Always populate the $HTTP_RAW_POST_DATA variable.
;always_populate_raw_post_data = On

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: “/path1:/path2”
;include_path = “.:/php/includes”
;
; Windows: “\path1;\path2”
;include_path = “.;c:\php\includes”

; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues. The alternate is to use the
; cgi.force_redirect configuration below
doc_root =

; The directory under which PHP opens the script using /~username used only
; if nonempty.
user_dir =

; Directory in which the loadable extensions (modules) reside.
extension_dir = “C:\php\extensions\”

; Whether or not to enable the dl() function. The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
enable_dl = On

; cgi.force_redirect is necessary to provide security running PHP as a CGI under
; most web servers. Left undefined, PHP turns this on by default. You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; cgi.force_redirect = 1

; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
; every request.
; cgi.nph = 1

; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape
; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
; will look for to know it is OK to continue execution. Setting this variable MAY
; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
; cgi.redirect_status_env = ;

; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP’s
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
; this to 1 will cause PHP CGI to fix it’s paths to conform to the spec. A setting
; of zero causes PHP to behave as before. Default is zero. You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; cgi.fix_pathinfo=0

; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate
; security tokens of the calling client. This allows IIS to define the
; security context that the request runs under. mod_fastcgi under Apache
; does not currently support this feature (03/17/2002)
; Set to 1 if running under IIS. Default is zero.
; fastcgi.impersonate = 1;

; cgi.rfc2616_headers configuration option tells PHP what type of headers to
; use when sending HTTP response code. If it’s set 0 PHP sends Status: header that
; is supported by Apache. When this option is set to 1 PHP will send
; RFC2616 compliant header.
; Default is zero.
;cgi.rfc2616_headers = 0

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
upload_max_filesize = 100M

;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

; Define the anonymous ftp password (your email address)
;from=”john@doe.com”

; Define the User-Agent string
; user_agent=”PHP”

; Default timeout for socket based streams (seconds)
default_socket_timeout = 600

; If your scripts have to deal with files from Macintosh systems,
; or you are running on a Mac and need to deal with files from
; unix or win32 systems, setting this flag will cause PHP to
; automatically detect the EOL character in those files so that
; fgets() and file() will work regardless of the source of the file.
; auto_detect_line_endings = Off

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; … or under UNIX:
;
; extension=msql.so
;
; Note that it should be the name of the module only; no directory information
; needs to go here. Specify the location of the extension with the
; extension_dir directive above.

;Windows Extensions
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
;
;extension=php_bz2.dll
;extension=php_cpdf.dll
;extension=php_crack.dll
;extension=php_curl.dll
;extension=php_db.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_domxml.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_hyperwave.dll
;extension=php_iconv.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_printer.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
extension=php_sockets.dll
;extension=php_sybase_ct.dll
;extension=php_w32api.dll
;extension=php_xmlrpc.dll
;extension=php_xslt.dll
;extension=php_yaz.dll
;extension=php_zip.dll

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Syslog]
; Whether or not to define the various syslog variables (e.g. $LOG_PID,
; $LOG_CRON, etc.). Turning it off is a good idea performance-wise. In
; runtime, you can define these variables by calling define_syslog_variables().
define_syslog_variables = Off

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: “sendmail -t -i”).
;sendmail_path =

[Java]
;java.class.path = .\php_java.jar
;java.home = c:\jdk
;java.library = c:\jdk\jre\bin\hotspot\jvm.dll
;java.library.path = .\

[SQL]
sql.safe_mode = Off

[ODBC]
;odbc.default_db = Not yet implemented
;odbc.default_user = Not yet implemented
;odbc.default_pw = Not yet implemented

; Allow or prevent persistent links.
odbc.allow_persistent = On

; Check that a connection is still valid before reuse.
odbc.check_persistent = On

; Maximum number of persistent links. -1 means no limit.
odbc.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
odbc.max_links = -1

; Handling of LONG fields. Returns number of bytes to variables. 0 means
; passthru.
odbc.defaultlrl = 4096

; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char.
; See the documentation on odbc_binmode and odbc_longreadlen for an explanation
; of uodbc.defaultlrl and uodbc.defaultbinmode
odbc.defaultbinmode = 1

[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
mysql.max_links = -1

; Default port number for mysql_connect(). If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
mysql.default_port =

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default host for mysql_connect() (doesn’t apply in safe mode).
mysql.default_host =

; Default user for mysql_connect() (doesn’t apply in safe mode).
mysql.default_user =

; Default password for mysql_connect() (doesn’t apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run ‘echo get_cfg_var(“mysql.default_password”)
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
mysql.default_password =

; Maximum time (in secondes) for connect timeout. -1 means no limimt
mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Erros will be displayed.
mysql.trace_mode = Off

[mSQL]
; Allow or prevent persistent links.
msql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
msql.max_persistent = -1

; Maximum number of links (persistent+non persistent). -1 means no limit.
msql.max_links = -1

[PostgresSQL]
; Allow or prevent persistent links.
pgsql.allow_persistent = On

; Detect broken persistent links always with pg_pconnect(). Need a little overhead.
pgsql.auto_reset_persistent = Off

; Maximum number of persistent links. -1 means no limit.
pgsql.max_persistent = -1

; Maximum number of links (persistent+non persistent). -1 means no limit.
pgsql.max_links = -1

; Ignore PostgreSQL backends Notice message or not.
pgsql.ignore_notice = 0

; Log PostgreSQL backends Noitce message or not.
; Unless pgsql.ignore_notice=0, module cannot log notice message.
pgsql.log_notice = 0

[Sybase]
; Allow or prevent persistent links.
sybase.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
sybase.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
sybase.max_links = -1

;sybase.interface_file = “/usr/sybase/interfaces”

; Minimum error severity to display.
sybase.min_error_severity = 10

; Minimum message severity to display.
sybase.min_message_severity = 10

; Compatability mode with old versions of PHP 3.0.
; If on, this will cause PHP to automatically assign types to results according
; to their Sybase type, instead of treating them all as strings. This
; compatability mode will probably not stay around forever, so try applying
; whatever necessary changes to your code, and turn it off.
sybase.compatability_mode = Off

[Sybase-CT]
; Allow or prevent persistent links.
sybct.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
sybct.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
sybct.max_links = -1

; Minimum server message severity to display.
sybct.min_server_severity = 10

; Minimum client message severity to display.
sybct.min_client_severity = 10

[dbx]
; returned column names can be converted for compatibility reasons
; possible values for dbx.colnames_case are
; “unchanged” (default, if not set)
; “lowercase”
; “uppercase”
; the recommended default is either upper- or lowercase, but
; unchanged is currently set for backwards compatibility
dbx.colnames_case = “unchanged”

[bcmath]
; Number of decimal digits for all bcmath functions.
bcmath.scale = 0

[browscap]
;browscap = extra/browscap.ini

[Informix]
; Default host for ifx_connect() (doesn’t apply in safe mode).
ifx.default_host =

; Default user for ifx_connect() (doesn’t apply in safe mode).
ifx.default_user =

; Default password for ifx_connect() (doesn’t apply in safe mode).
ifx.default_password =

; Allow or prevent persistent links.
ifx.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
ifx.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
ifx.max_links = -1

; If on, select statements return the contents of a text blob instead of its id.
ifx.textasvarchar = 0

; If on, select statements return the contents of a byte blob instead of its id.
ifx.byteasvarchar = 0

; Trailing blanks are stripped from fixed-length char columns. May help the
; life of Informix SE users.
ifx.charasvarchar = 0

; If on, the contents of text and byte blobs are dumped to a file instead of
; keeping them in memory.
ifx.blobinfile = 0

; NULL’s are returned as empty strings, unless this is set to 1. In that case,
; NULL’s are returned as string ‘NULL’.
ifx.nullformat = 0

[Session]
; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP’s session functions.
; As of PHP 4.0.1, you can define the path as:
; session.save_path = “N;/path”
; where N is an integer. Instead of storing all the session files in
; /path, what this will do is use subdirectories N-levels deep, and
; store the session data in those directories. This is useful if you
; or your OS have problems with lots of files in one directory, and is
; a more efficient layout for servers that handle lots of sessions.
; NOTE 1: PHP will not create this directory structure automatically.
; You can use the script in the ext/session dir for that purpose.
; NOTE 2: See the section on garbage collection below if you choose to
; use subdirectories for session storage
;session.save_path = /tmp

; Whether to use cookies.
session.use_cookies = 1

; This option enables administrators to make their users invulnerable to
; attacks which involve passing session ids in URLs; defaults to 0.
; session.use_only_cookies = 1

; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Handler used to serialize data. php is the standard serializer of PHP.
session.serialize_handler = php

; Define the probability that the ‘garbage collection’ process is started
; on every session initialization.
; The probability is calculated by using gc_probability/gc_divisor,
; e.g. 1/100 means there is a 1% chance that the GC process starts
; on each request.

session.gc_probability = 1
session.gc_divisor = 100

; After this number of seconds, stored data will be seen as ‘garbage’ and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

; NOTE: If you are using the subdirectory option for storing session files
; (see session.save_path above), then garbage collection does *not*
; happen automatically. You will need to do your own garbage
; collection through a shell script, cron entry, or some other method.
; For example, the following script would is the equivalent of
; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
; cd /path/to/sessions; find -cmin +24 | xargs rm

; PHP 4.2 and less have an undocumented feature/bug that allows you to
; to initialize a session variable in the global scope, albeit register_globals
; is disabled. PHP 4.3 and later will warn you, if this feature is used.
; You can disable the feature and the warning seperately. At this time,
; the warning is only displayed, if bug_compat_42 is enabled.

session.bug_compat_42 = 1
session.bug_compat_warn = 1

; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
session.referer_check =

; How many bytes to read from the file.
session.entropy_length = 0

; Specified here to create the session id.
session.entropy_file =

;session.entropy_length = 16

;session.entropy_file = /dev/urandom

; Set to {nocache,private,public,} to determine HTTP caching aspects
; or leave this empty to avoid sending anti-caching headers.
session.cache_limiter = nocache

; Document expires after n minutes.
session.cache_expire = 180

; trans sid support is disabled by default.
; Use of trans sid may risk your users security.
; Use this option with caution.
; – User may send URL contains active session ID
; to other person via. email/irc/etc.
; – URL that contains active session ID may be stored
; in publically accessible computer.
; – User may access your site with the same session ID
; always using URL stored in browser’s history or bookmarks.
session.use_trans_sid = 0

; The URL rewriter will look for URLs in a defined set of HTML tags.
; form/fieldset are special; if you include them here, the rewriter will
; add a hidden field with the info which is otherwise appended
; to URLs. If you want XHTML conformity, remove the form entry.
; Note that all valid entries require a “=”, even if no value follows.
url_rewriter.tags = “a=href,area=href,frame=src,input=src,form=,fieldset=”

[MSSQL]
; Allow or prevent persistent links.
mssql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
mssql.max_persistent = -1

; Maximum number of links (persistent+non persistent). -1 means no limit.
mssql.max_links = -1

; Minimum error severity to display.
mssql.min_error_severity = 10

; Minimum message severity to display.
mssql.min_message_severity = 10

; Compatability mode with old versions of PHP 3.0.
mssql.compatability_mode = Off

; Connec timeout
;mssql.connect_timeout = 5

; Query timeout
;mssql.timeout = 60

; Valid range 0 – 2147483647. Default = 4096.
;mssql.textlimit = 4096

; Valid range 0 – 2147483647. Default = 4096.
;mssql.textsize = 4096

; Limits the number of records in each batch. 0 = all records in one batch.
;mssql.batchsize = 0

; Specify how datetime and datetim4 columns are returned
; On => Returns data converted to SQL server settings
; Off => Returns values as YYYY-MM-DD hh:mm:ss
;mssql.datetimeconvert = On

; Use NT authentication when connecting to the server
mssql.secure_connection = Off

; Specify max number of processes. Default = 25
;mssql.max_procs = 25

[Assertion]
; Assert(expr); active by default.
;assert.active = On

; Issue a PHP warning for each failed assertion.
;assert.warning = On

; Don’t bail out by default.
;assert.bail = Off

; User-function to be called if an assertion fails.
;assert.callback = 0

; Eval the expression with current error_reporting(). Set to true if you want
; error_reporting(0) around the eval().
;assert.quiet_eval = 0

[Ingres II]
; Allow or prevent persistent links.
ingres.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
ingres.max_persistent = -1

; Maximum number of links, including persistents. -1 means no limit.
ingres.max_links = -1

; Default database (format: [node_id::]dbname[/srv_class]).
ingres.default_database =

; Default user.
ingres.default_user =

; Default password.
ingres.default_password =

[Verisign Payflow Pro]
; Default Payflow Pro server.
pfpro.defaulthost = “test-payflow.verisign.com”

; Default port to connect to.
pfpro.defaultport = 443

; Default timeout in seconds.
pfpro.defaulttimeout = 30

; Default proxy IP address (if required).
;pfpro.proxyaddress =

; Default proxy port.
;pfpro.proxyport =

; Default proxy logon.
;pfpro.proxylogon =

; Default proxy password.
;pfpro.proxypassword =

[Sockets]
; Use the system read() function instead of the php_read() wrapper.
sockets.use_system_read = On

[com]
; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
;com.typelib_file =
; allow Distributed-COM calls
;com.allow_dcom = true
; autoregister constants of a components typlib on com_load()
;com.autoregister_typelib = true
; register constants casesensitive
;com.autoregister_casesensitive = false
; show warnings on duplicate constat registrations
;com.autoregister_verbose = true

[Printer]
;printer.default_printer = “”

[mbstring]
; language for internal character representation.
mbstring.language = zh-cn

; internal/script encoding.
; Some encoding cannot work as internal encoding.
; (e.g. SJIS, BIG5, ISO-2022-*)
mbstring.internal_encoding = zh-cn

; http input encoding.
mbstring.http_input = auto

; http output encoding. mb_output_handler must be
; registered as output buffer to function
mbstring.http_output = big5

; enable automatic encoding translation accoding to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
; portable libs/applications.
;mbstring.encoding_translation = Off

; automatic encoding detection order.
; auto means
mbstring.detect_order = auto

; substitute_character used when character cannot be converted
; one from another
mbstring.substitute_character = none;

; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
;mbstring.func_overload = 0

[FrontBase]
;fbsql.allow_persistent = On
;fbsql.autocommit = On
;fbsql.default_database =
;fbsql.default_database_password =
;fbsql.default_host =
;fbsql.default_password =
;fbsql.default_user = “_SYSTEM”
;fbsql.generate_warnings = Off
;fbsql.max_connections = 128
;fbsql.max_links = 128
;fbsql.max_persistent = -1
;fbsql.max_results = 128
;fbsql.batchSize = 1000

[Crack]
; Modify the setting below to match the directory location of the cracklib
; dictionary files. Include the base filename, but not the file extension.
; crack.default_dictionary = “c:\php\lib\cracklib_dict”

[exif]
; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.
; With mbstring support this will automatically be converted into the encoding
; given by corresponding encode setting. When empty mbstring.internal_encoding
; is used. For the decode settings you can distinguish between motorola and
; intel byte order. A decode setting cannot be empty.
;exif.encode_unicode = ISO-8859-15
;exif.decode_unicode_motorola = UCS-2BE
;exif.decode_unicode_intel = UCS-2LE
;exif.encode_jis =
;exif.decode_jis_motorola = JIS
;exif.decode_jis_intel = JISmbstring

; Local Variables:
; tab-width: 4
; End:
[Zend]
zend_optimizer.optimization_level=15
zend_extension_ts=”D:\webserver\lib\ZendExtensionManager.dll”
zend_extension_manager.optimizer_ts=”D:\webserver\lib\Optimizer-2.5.2″