PHP运行环境配置和开发环境的配置 教程

 更新时间:2016年11月25日 15:29  点击:1854

今天我就在Windows平台下搭建PHP的调试和开发环境。如果有写的不好的请谅解。

   一、总的大概步骤如下

   1、下载资料
      1)、下载wamp
      2)、下载开发工具ZendStudio

   2、安装程序
      1)、安装wamp
      2)、安装开发工具ZendStudio

   3、配置环境
  
   4、PHP调试

   5、PHP开发环境

二、步骤详细介绍

  1、下载资料
      1)、下载WAMP

         所谓WAMP,是指在Windows系统(W)下安装Apache网页服务器(A)以及MySQL数据库教程(M)和PHP脚本引擎(P)而搭建起来的PHP网络服务器环境,当然,在LAMP环境肯定是比WAMP环境要好的,可是由于Windows的易用性,所以,我们在做前期开发或者测试某些CMS的时候,使用WAMP环境甚至很方便更实用一些。WAMP即这些单个软件共同组成了一个强大的Web应用程序平台。

     下载WAMP最新帮Wamp5 http://9.scdx1.crsky.com/200711/WAMP5-v1.7.4.rar


      2)、下载开发工具ZendStudio

         Zend Studio是PHP 集成开发环境,具备功能强大的专业编辑工具和调试工具,支持PHP语法加亮显示,支持语法自动填充功能,支持书签功能,支持语法自动缩排和代码复制功能,内置一个强大的PHP代码调试工具,支持本地和远程两种调试模式,支持多种高级调试功能。 

  •  windows版 Zend Studio 8.0.1 正式版官方下载地址:http://downloads.zend.com/..ZendStudio-8.0.1.msi 

   2、安装程序
      1)、WAMP 安装步骤图解

把WAMP下载到

选择WAMP安装路径,也可以默认路径。

SMP服务器地址

PHP 邮件服务器默认Email

设置启动浏览器。

安装完成,显示图片。

   3、配置环境

安装完成后默认是英文。

设置WAMP语言。您可以设置其他的语言,当然我们设置为Chinese(中文)

WAMP重启以后就为中文了。您就可以通过WAMP去配置PHP环境了。

添加一个Alias目录,(就像在IIS上配置一个虚拟目录)

添加一个Alias目录名称。

设置Alias目录名称指向的物理路径。

 4、PHP调试

  

在C:wampphp教程Demo文件夹中添加Index.php文件,这时就可以在index.php 编写PHP代码了。

在浏览器地址栏中输入:Http://localhost/ 如果能看到上图PHP服务器配置相关信息,说明您的PHP服务器配置成功。

你可以直接访问http://localhost/Demo 就可以查看刚才编写的index.php程序。显示页面执行的结果。

  2)、PHP开发工具ZendStudio安装图解

Zend Studio安装过程很简单,点击“Next”、“Next"基本就可以搞定。

安装完成后,你就可以添加一个PHP项目,编写你的PHP网站。在创建PHP项目时,要填写项目名称和保持路径。

这是你就可以在项目中添加PHP文件。编写PHP页面。

 5、PHP开发环境

点击运行,就可以在Zend Studion IDE中浏览PHP页面执行的内容。


如果PHP在编写中有错误,运行时就可以清楚的PHP文件中的第多少行出了错误。调试也非常方便。

下载PHP5:    php教程.net/distributions/php-5.2.6-Win32.zip" target="_blank">http://cn2.php.net/distributions/php-5.2.6-Win32.zip
下载apache:  http://down.chinaz.com/soft/18000.htm


一.php的安装与调试
        由于php是一个zip文件(非install版),安装较为简单,解压就行。把解压的 php5.2.1-Win32重命名为 php5。并复制到C盘目录下。即安装路径为 c:php5
1     找到php目录下的 php.ini-dist或 php.ini.recommended文件,重命名为 php.ini
并复制到系统盘的windows目录下(以c:windows为例).
2     再把php目录下的php5ts.dll,libmysql教程.dll复制到目录 c:windowssystem32下。
3     把php5ext目录下的php_gd2.dll,php_mysql.dll,php_mbstring.dll文件复制到c:windowssystem32下
如果没有加载 php_gd2.dll     php将不能处理图像。没有加载php_mysql.dll php将不支持mysql函数库
php_mbstring.dll在后面使用phpmyadmin时支持宽字符。
4 打开c:windowsphp.ini文件(关联到mysql)
设置扩展路径
查找 extension_dir 有这么一行extension_dir = "./"
将此行改成
extension_dir = "C:php5ext"
其中C:php5是你安装php的路径。路径不正确将无法加载dll
(注意:有些php版本是 ;extension_dir = "./" 要把前面的分号去掉)
查找 extension
extension=php_mbstring.dll
extension=php_gd2.dll
extension=php_mysql.dl
把上面3项前面的分号去掉,这样apache启动时就可以加载这些dll了
当然前面我们也把这些dll复制到system32下了l
php5时差问题
<?php echo date("Y-m-d H:i:s");?>时间相差八小时
为什么呢?PHP5系列版本新增了时区设置,默认为格林威治时间,与中国所在的东8区正好相差8个小时
查找date.timezone有这么一行
;date.timezone =
将;去掉,改成
date.timezone = PRC
二.apache的调试和整合
1.修改网站根目录
      查找 DocumentRoot有这么一行
DocumentRoot"C:/Program Files/Apache Group/Apache2/htdocs"
这就是你网站的根目录,你可以修改,也可以用默认的.如果改,还要修改下面这项,否则可能会出现 403 错误
查找     This should be changed to whatever you set DocumentRoot to
在它下面两行有
<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
把上面两项的 C:/Program Files/Apache Group/Apache2/htdocs 改成你想要的目录
2.让apache支持*.php(网页)
查找     DirectoryIndex index.html index.html.var
修改成
DirectoryIndex   index.html index.html.var   index.php 
这样index.php 可以充当默认页面了
3.Apache中模块化安装php
查找 # LoadModule foo_module modules/mod_foo.so
在此行后加入一行
LoadModule php5_module C:/php5/php5apache2.dll          //注意:其中C:/php5/php5apache2.dll是你安装php的相应路径.不要把php5apache2.dll和php5apache.dll混淆.php5apache.dll只适用于apache 版本1的.PHP5压缩包里的php5apache2.dll只适用于apache2.0.*版本,如果是2.2.*以上版本,就可能会出现"Cannot load C:/php/php5apache2.dll into server: The specified module could not be found."或者:"The requested operation has failed"
4.查找 AddType application/x-gzip .gz .tgz
在此行后加入一行
AddType application/x-httpd-php .php (记住:前边有一个空格哦!!!)
这样apache就可以解释php文件了
5.测试
在网站根目录下创建一个 phpinfo.php 文件

<?php
phpinfo();
?>

在浏览器打开
http://localhost/phpinfo.php
5.测试php和mysql数据库教程的关联
在网站根目录下创建一个test.php 文件

<?php
$link=mysql_connect("localhost","root","12345");     //12345改成你的mysql密码
if(!$link) echo "失败!";
else echo "成功!";
mysql_close();
?>

在浏览器打开 http://localhost/test.php
如果输出成功,则说明大功告成了

php教程配置中文解说

先看看大家看到的php.ini

[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://www.111cn.net
;;;;;;;;;;;;;;;;;;;
; About php.ini   ;
;;;;;;;;;;;;;;;;;;;
; This file controls many asp教程ects 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.
;
;
;;;;;;;;;;;;;;;;;;;
; About this file ;
;;;;;;;;;;;;;;;;;;;
; 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

; Enable compatibility mode with Zend Engine 1 (PHP 4.x)
zend.ze1_compatibility_mode = Off

; Allow the <? tag.  Otherwise, only <?php and <script> 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 = On

; 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".
; Note: output_handler must be empty if this is set 'On' !!!!
;       Instead you must use zlib.output_handler.
;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
;zlib.output_compression_level = -1

; 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 be called (with the undefined class'
; name as parameter), if the unserializer finds an undefined class
; which should be instantiated.
; 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
; <span style="color: ???????"> would work.
;highlight.string  = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.bg      = #FFFFFF
;highlight.default = #0000BB
;highlight.html    = #000000

; If enabled, the request will be allowed to complete even if the user aborts
; the request. Consider enabling it if executing long request, which may end up
; being interrupted by the user or a browser timing out.
; ignore_user_abort = On

; Determines the size of the realpath cache to be used by PHP. This value should
; be increased on systems where PHP opens many files to reflect the quantity of
; the file operations performed.
; realpath_cache_size=16k

; Duration of time, in seconds for which to cache realpath information for a given
; file or directory. For systems with rarely changing files, consider increasing this
; value.
; realpath_cache_ttl=120

;
; 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 = 30     ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
;max_input_nesting_level = 64 ; Maximum input variable nesting level
memory_limit = 128M      ; Maximum amount of memory a script may consume (128MB)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 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 (doesn't include E_STRICT)
; E_ERROR           - fatal run-time errors
; E_RECOVERABLE_ERROR  - almost 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_STRICT          - run-time notices, enable to have PHP suggest changes
;                     to your code which will ensure the best interoperability
;                     and forward compatibility of your code
; 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 and coding standards warnings
;
;error_reporting = E_ALL & ~E_NOTICE
;
;   - Show all errors, except for notices
;
;error_reporting = E_ALL & ~E_NOTICE | E_STRICT
;
;   - Show only errors
;
;error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
;
;   - Show all errors except for notices and coding standards warnings
;
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.
;
; possible values for display_errors:
;
; Off        - Do not display any errors
; stderr     - Display errors to STDERR (affects only CGI/CLI binaries!)
;
;display_errors = "stderr"
;
; stdout (On) - Display errors to STDOUT
;
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 unless 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
; source lines.
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

;report_zend_debug = 0

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

; Turn off normal error reporting and emit XML-RPC error XML
;xmlrpc_errors = 0
; An XML-RPC faultCode
;xmlrpc_error_number = 0

; Disable the inclusion of HTML tags in error messages.
; Note: Never use this feature for production boxes.
;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.
; Note: Never use this feature for production boxes.
;docref_root = "/phpmanual/"
;docref_ext = .html

; String to output before an error message.
;error_prepend_string = "<font color=#ff0000>"

; String to output after an error message.
;error_append_string = "</font>"

; 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 = "&amp;"

; 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

; Whether or not to register the old-style input arrays, HTTP_GET_VARS
; and friends.  If you're not using them, it's recommended to turn them off,
; for performance reasons.
register_long_arrays = 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

; When enabled, the SERVER and ENV variables are created when they're first
; used (Just In Time) instead of when the script starts. If these variables
; are not used within a script, having this directive on will result in a
; performance gain. The PHP directives register_globals, register_long_arrays,
; and register_argc_argv must be disabled for this directive to have any affect.
auto_globals_jit = On

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

; 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 = "iso-8859-1"

; 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:phpincludes"

; 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 = "D:phpStudyphpStudyPHP5ext"

; 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 1.  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;

; Disable logging through FastCGI connection
; fastcgi.logging = 0

; 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


; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20

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

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

; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
allow_url_include = Off

; 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 = 60

; 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 ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.

;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.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_msql.dll
;extension=php_mssql.dll
extension=php_mysql教程.dll
;extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
extension=php_pdo.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_ps教程pell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
extension=php_zip.dll

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

[Date]
; Defines the default timezone used by the date functions
date.timezone =PRC

;date.default_latitude = 31.7667
;date.default_longitude = 35.2333

;date.sunrise_zenith = 90.583333
;date.sunset_zenith = 90.583333

[filter]
;filter.default = unsafe_raw
;filter.default_flags =

[iconv]
;iconv.input_encoding = ISO-8859-1
;iconv.internal_encoding = ISO-8859-1
;iconv.output_encoding = ISO-8859-1

[sqlite]
;sqlite.assoc_case = 0

[Pcre]
;PCRE library backtracking limit.
;pcre.backtrack_limit=100000

;PCRE library recursion limit.
;Please note that if you set this value to a high number you may consume all
;the available process stack and eventually crash PHP (due to reaching the
;stack size limit imposed by the Operating System).
;pcre.recursion_limit=100000

[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 =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

[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 seconds) for connect timeout. -1 means no limit
mysql.connect_timeout = 60

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

[MySQLi]

; Maximum number of links.  -1 means no limit.
mysqli.max_links = -1

; Default port number for mysqli_connect().  If unset, mysqli_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.
mysqli.default_port = 3306

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

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

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

; Default password for mysqli_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("mysqli.default_pw")
; and reveal this password!  And of course, any users with read access to this
; file will be able to reveal the password as well.
mysqli.default_pw =

; Allow or prevent reconnect
mysqli.reconnect = 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

[OCI8]
; enables privileged connections using external credentials (OCI_SYSOPER, OCI_SYSDBA)
;oci8.privileged_connect = Off

; Connection: The maximum number of persistent OCI8 connections per
; process. Using -1 means no limit.
;oci8.max_persistent = -1

; Connection: The maximum number of seconds a process is allowed to
; maintain an idle persistent connection. Using -1 means idle
; persistent connections will be maintained forever.
;oci8.persistent_timeout = -1

; Connection: The number of seconds that must pass before issuing a
; ping during oci_pconnect() to check the connection validity. When
; set to 0, each oci_pconnect() will cause a ping. Using -1 disables
; pings completely.
;oci8.ping_interval = 60

; Tuning: This option enables statement caching, and specifies how
; many statements to cache. Using 0 disables statement caching.
;oci8.statement_cache_size = 20

; Tuning: Enables statement prefetching and sets the default number of
; rows that will be fetched automatically after statement execution.
;oci8.default_prefetch = 10

; Compatibility. Using On means oci_close() will not close
; oci_connect() and oci_new_connect() connections.
;oci8.old_oci_close_semantics = Off

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

; Detect broken persistent links always with pg_pconnect().
; Auto reset feature requires a little overheads.
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.
; Notice message logging require a little overheads.
pgsql.ignore_notice = 0

; Log PostgreSQL backends Notice 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

; Compatibility 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
; compatibility 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

[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
;
; The file storage module creates files using mode 600 by default.
; You can change that by using
;
;     session.save_path = "N;MODE;/path"
;
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process's umask.
;session.save_path = "/tmp"

; Whether to use cookies.
session.use_cookies = 1

;session.cookie_secure =

; 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 =

; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript.
session.cookie_httponly =

; 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 separately. 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

; Select a hash function
; 0: MD5   (128 bits)
; 1: SHA-1 (160 bits)
session.hash_function = 0

; Define how many bits are stored in each character when converting
; the binary hash data to something readable.
;
; 4 bits: 0-9, a-f
; 5 bits: 0-9, a-v
; 6 bits: 0-9, a-z, A-Z, "-", ","
session.hash_bits_per_character = 4

; 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 <input> 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

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

; Connect 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. -1 = library default
; msdlib defaults to 25
; FreeTDS defaults to 4096
;mssql.max_procs = -1

; Specify client character set.
; If empty or not set the client charset from freetds.comf is used
; This is only used when compiled with FreeTDS
;mssql.charset = "ISO-8859-1"

[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

[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 constant registrations
;com.autoregister_verbose = true

[mbstring]
; language for internal character representation.
;mbstring.language = Japanese

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

; http input encoding.
;mbstring.http_input = auto

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

; enable automatic encoding translation according 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.show_timestamp_decimals = Off
;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

[gd]
; Tell the jpeg decode to libjpeg warnings and try to create
; a gd image. The warning will then be displayed as notices
; disabled by default
;gd.jpeg_ignore_warning = 0

[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    = JIS

[Tidy]
; The path to a default tidy configuration file to use when using tidy
;tidy.default_config = /usr/local/lib/php/default.tcfg

; Should tidy clean and repair output automatically?
; WARNING: Do not use this option if you are generating non-html content
; such as dynamic images
tidy.clean_output = Off

[soap]
; Enables or disables WSDL caching feature.
soap.wsdl_cache_enabled=1
; Sets the directory name where SOAP extension will put cache files.
soap.wsdl_cache_dir="/tmp"
; (time to live) Sets the number of second while cached file will be used
; instead of original one.
soap.wsdl_cache_ttl=86400

; Local Variables:
; tab-width: 4
; End:

[Zend]
zend_extension_manager.optimizer_ts ="D:phpStudyphpStudyZendOptimizerlibOptimizer"
zend_extension_ts = "D:phpStudyphpStudyZendOptimizerlibZendExtensionManager.dll"
zend_optimizer.optimization_level=15


再来看个中文版的php.ini
;;;;;;;;;;;
; 警告 ;
;;;;;;;;;;;
; 此配置文件是对于新安装的PHP的默认设置.
; 默认情况下,PHP使用此配置文件安装
; 此配置针对开发目的,并且*不是*针对生产环境
; 基于一些安全方面的考虑,在你的网站上线之前,请考虑使用php.ini-recommended
; 以及在线文档 http://php.net/manual/en/security.php.


;;;;;;;;;;;;;;;;;;;
; 关于 php.ini   ;
;;;;;;;;;;;;;;;;;;;
; 此文件控制了PHP行为的很多方面.  为了让PHP能够读取它
; 必须命名为 'php.ini'.  PHP 在其当前工作目录,由PHPRC环境变量指定目录
; 以及由编译时指定的目录(按此顺序)查找此文件
; 在Windows环境下, 编译时目录是Windows目录.
; 在命令行模式下查找php.ini的目录可以被-c参数覆盖.
;
; 此文件的语法非常简单.
; 空行和由分号开始的行会被忽略(你可能已经猜到了).
; 段的开头(例如 [Foo]) 同样会被悄悄忽略
; 即使在将来他们可能会有其他作用.
;
; 使用以下语法来设定指令:
; directive = value
; 指令 = 值
; 指令名称是 *大小写敏感* - foo=bar 和 FOO=bar 是不同的.
;
; 值可以是字符串,数值,PHP常量 (例如 E_ALL 和 M_PI),
; INI 常量 (On, Off, True, False, Yes, No 和 None) 或者一个表达式
; (例如 E_ALL & ~E_NOTICE), 或者带引号的字串 ("foo").
;
; 在INI文件中的表达式只能使用逻辑运算和圆括号:
; |        逻辑或
; &       逻辑与
; ~       逻辑非
; !        取反
;
; 逻辑标志可以使用1,On,True或者Yes来打开.
; 也可以使用0, Off, False 或者 No来关闭.
;
; 在等号后面不写任何内容代表了一个空字符串
; 或者使用 None 关键词:
;
;  foo =         ; 将foo设置成一个空字串
;  foo = none    ; 将foo设置成一个空字串
;  foo = "none"  ; 将foo设置成字串 'none'
;
; 如果你在值中使用了常量, 并且这个常量属于一个动态加载的扩展模块
; (不论是PHP扩展还是Zend扩展),
; 那你只能在加载这些扩展 *之后* 使用这些常量.
;
;
;;;;;;;;;;;;;;;;;;;
; 关于这个文件  ;
;;;;;;;;;;;;;;;;;;;
; 在php.ini-dist 文件中所有的值都相当于内建的默认值
; (就是如果没有使用php.ini, 或者如果你删除了这些行,
; 就和内建的默认值一样).


;;;;;;;;;;;;;;;;;;;;
; 语言选项 ;
;;;;;;;;;;;;;;;;;;;;

; 打开在Apache下的PHP脚本语言引擎
engine = On

; 打开Zend Engine兼容模式(PHP 4.x)
zend.ze1_compatibility_mode = Off

; 允许 <? 标签.  否则,只有 <?php 和 <script> 标签被认为是PHP脚本.
; 注意: 尽可能避免在开发可重新发布的程序或者库的时候使用简略标签,或者在不受你控制的服务器下发布,
; 因为简略标签可能不被目标服务器支持.为了可移植性, 可重新发布的代码, 请不要使用简略标签
short_open_tag = On

; 使用ASP风格 <% %> 标签.
asp_tags = Off

; 浮点数中数值的有效位数(浮点数精度).
precision    =  12

; 强制2000年兼容 (可能引起不兼容浏览器的问题)
y2k_compliance = On

; 输出缓冲允许在你发送了body内容之后发送header(包括 cookies)
; 代价是稍稍减缓了PHP输出层
; 你可以在运行时调用 output buffering 函数来打开此功能
; 你也可以将此指令设置为On来对所有文件打开输出缓冲
; 如果你想将这个缓冲区限制到特定大小 - 你可以使用最大的字节数来代替'On',来作为这个指令的参数 (例如 output_buffering=4096).
output_buffering = Off

; 你可以将所有你脚本输出的内容重定向到指定函数. 
; 例如, 如果你设置 output_handler 到 "mb_output_handler",
; 字符编码会被转换成为指定的编码..
; 设置任何的输出处理句柄会自动打开输出缓冲.
; 注意: 如果想编写可移植脚本就不要依赖此INI配置
;       取而代之的是, 明确的使用 ob_start() 来设置输出处理句柄.
;       使用此ini指令可能引起问题,除非你很清楚的理解脚本正在做什么.
; 注意: 你不能同时使用 "mb_output_handler" 和 "ob_iconv_handler"
;       并且你不能同时使用 "ob_gzhandler" 和 "zlib.output_compression".
; 注意: 如果使用zlib.output_handler指令开启zlib输出压缩, 该指令必须为空.
;output_handler =

; 使用zlib库对输出进行压缩
; 对此选项的有效值是 'off', 'on', 或者字节数 (用来压缩的缓冲大小 , 默认是 4KB)
; 注意: 结果的chunk大小可能由于压缩对象的大小而不同.
;       PHP输出块的大小一般压缩之后每个大小时几百个字节.
;       如果你希望藉由一个大块的堆大小来获取更好的性能, 需要额外的打开 output_buffering 选项.
; 注意: 你必须使用 zlib.output_handler 来替代标准的
;       output_handler, 否则输出可能会有问题.
zlib.output_compression = Off
;zlib.output_compression_level = -1

; 这里激活 zlib.output_compression 之后,你无法再指定额外的输出处理.
; 这个设置和 output_handler 一样,但是处理顺序不同.
;zlib.output_handler =

; 立即刷新告知 PHP 让输出层在每次输出块之后立刻自动刷新.
; 这和每次调用print()或者echo()函数以及任何一种HTML块后调用flush()一样.
; 打开此选项会严重导致性能下降,一般只有用于调试情况下才建议打开.
implicit_flush = Off

; 如果反序列器找到一个可以作为示例的未定义类.未序列化的回调函数会被调用(使用未定义的类名作为参数),
; 如果特定的函数未被定义或者如果此函数没有包含/实现丢失的类,则会发生一个警告.
; 如果只有你真想要实现类似的回调函数,才设定此入口.
unserialize_callback_func=

; 当浮点和双精度被序列化后,浮点号后由 serialize_precision 指定存储精确度的有效位数.
; 默认值是当浮点数被反序列解码后,数值仍旧相同.
serialize_precision = 100

; 是否打开强制通过引用传递参数给函数
; 此方法被反对并且很有可能在未来版本的PHP/Zend中不再被支持.
; 被孤立的指定的方法是参数应该在函数被声明的时候按照引用传入.
; 你被鼓励来尝试上述方法并关闭此选项来确保你脚本在今后的新版本中仍旧可以正常工作 ( 每次你使用此特性的时候会受到一个警告
; 并且参数会传值而不是传引用).
allow_call_time_pass_reference = On

;
; 安全模式
;
safe_mode = Off

; 默认情况下,安全模式在打开文件时,使用UID来比对检测.
; 如果你只想使用GID做宽松的比对,
; 打开 safe_mode_gid.
safe_mode_gid = Off

; 当 safe_mode 被打开, 此目录下包含的文件和子文件夹的UID/GID 检测会被绕过.
; (目录必须在 include_path 中存在或者必须在包含时使用全路径)
safe_mode_include_dir =

; 当 safe_mode 被打开, 只有在 safe_mode_exec_dir 中定义的可执行文件能够通过exec函数组打开执行.
safe_mode_exec_dir =

; 设定某些的环境变量可能成为潜在的安全隐患.
; 此指令包含一个逗号分隔的前导列表.
; 在安全模式中, 用户可能只能改变符合这里所给出前导字符的变量.
; 默认情况下,用户只能改变以PHP_开头的变量(例如. PHP_FOO=BAR).
;
; 注意:  如果此指令为空, PHP会允许用户修改任何环境变量!
safe_mode_allowed_env_vars = PHP_

; 此指令包含了一个用逗号分隔的环境变量列表, 用户无法通过 putenv() 函数来修改列表中的环境变量.
; 这些变量即便已经在 safe_mode_allowed_env_vars 所设定的列表中,也会被被保护不允许修改.
safe_mode_protected_env_vars = LD_LIBRARY_PATH

; 如果设置了open_basedir, 将会限制文件操作只能是此指令下的目录和子目录.
; 此指令对于每目录或者每虚拟主机配置文件最有意义. 此指令* 不会 *受安全模式开或者关的影响.
;open_basedir =

; 此指令允许你为了安全原因关闭指定的函数.
; 它接受以逗号分隔的函数名的列表.
; 此指令* 不会 *受安全模式开或者关的影响.
disable_functions =

; 此指令允许你由于安全原因关闭指定的类.
; 它接受以逗号分隔的类名的列表.
; 此指令* 不会 *受安全模式开或者关的影响.
disable_classes =

; 语法高亮模式的色彩. 任何在 <span style="color: ???????"> 中可接受的值都可以使用.
;highlight.string  = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.bg      = #FFFFFF
;highlight.default = #0000BB
;highlight.html    = #000000

; 如果打开, 即便用户放弃了的请求也会被执行完成.
; 在执行可能被用户打断或者浏览器超时所中断的请求时打开此选项.
; ignore_user_abort = On

; 指定PHP使用的实际路径的缓冲. 对于PHP打开很多文件来处理很多文件操作的系统上,应该增加此值.
; realpath_cache_size=16k

; 对于给定文件或者目录的缓冲真实路径信息的缓冲保留秒数. 对于很少修改文件的系统可以考虑增加此值.
; realpath_cache_ttl=120

;
; 其他
;
; 考虑到PHP可能被其所安装的服务器上暴露的事实(例如. 被web服务器作为头部信息的签名).
; 任何情况下这虽然不是安全威胁, 仍有可能暴露在你的服务器上是否正在使用PHP.
expose_php = On


;;;;;;;;;;;;;;;;;;;
; 资源限制 ;
;;;;;;;;;;;;;;;;;;;

; 每个脚本最大执行秒数
max_execution_time = 30
; 每个脚本用来分析请求数据的最大时间
max_input_time = 60
; 最大输入变量的嵌套级别
;max_input_nesting_level = 64
; 每个脚本能够使用的最大内存数量 (128MB)
memory_limit = 128M


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 错误处理和记录 ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; 错误报告时一个位. 对每一个数值取或可以得到最终的报告级别
; E_ALL             - 所有错误和警告 (不包含 E_STRICT)
; E_ERROR           - 致命的运行时错误
; E_RECOVERABLE_ERROR  - 几乎致命的运行时错误
; E_WARNING         - 运行时警告 (非致命错误)
; E_PARSE           - 编译时语法错误
; E_NOTICE          - 运行时提醒 (这些警告常常由你代码中的bug导致, 但是也有可能是有意的行为 (例如, 使用一个未初始化的变量并依赖于其会被自动初始化成为一个空字符串的事实)
; E_STRICT          - 运行时提醒, 打开后PHP会给出针对你代码的最易移植和最好向后兼容性的建议
; E_CORE_ERROR      - PHP初始化启动时的致命错误
; E_CORE_WARNING    - 在PHP初始化时发生的警告 (非致命错误)
; E_COMPILE_ERROR   - 致命的编译时错误
; E_COMPILE_WARNING - 编译时警告 (非致命)
; E_USER_ERROR      - 用户产生的错误信息
; E_USER_WARNING    - 用户产生的警告信息
; E_USER_NOTICE     - 用户产生的提示信息
;
;例子:
;
;   - 显示所有错误, 除了提示以及代码标准警告以外
;
;error_reporting = E_ALL & ~E_NOTICE
;
;   - 显示所有错误,除了提示以外
;
;error_reporting = E_ALL & ~E_NOTICE | E_STRICT
;
;   - 只显示错误
;
;error_reporting = E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR
;
;   - 显示出了提示以及代码标准警告之外的错误
;
error_reporting  =  E_ALL & ~E_NOTICE

; 打印输出错误 (作为输出的一部分).  对于生产环境的网站来说,
; 强烈建议你关闭此选项, 使用错误日志来替代 (详情参考下面内容). 
; 在一个生产环境下的web站点打开display_errors可能泄漏安全信息给最终用户, 例如web服务器的文件路径,你数据库教程的结构或者其他信息.
;
; display_errors可用的值:
;
; Off        - 不显示任何错误信息
; stderr     - 将错误信息输出到STDERR (只有 CGI/CLI 格式下有效!)
;
;display_errors = "stderr"
;
; stdout (On) - 输出错误信息到STDOUT上
;
display_errors = On

; 即使 display_errors 打开后,PHP启动序列中发生的错误也不会显示.
; 强烈建议你保持 display_startup_errors 关闭状态, 除非在排错
display_startup_errors = Off

; 将错误输入到日志文件 (服务器指定的log,stderr或者error_log (以下指定))
; 和上面提到的一样, 强烈建议你在生产环境的web站点下使用错误日志来代替错误显示.
log_errors = Off

; 设定log_errors的最大长度. 在 error_log 关于源的信息也计算在内.
; 默认是1024, 设置为0可以不限制任何最大长度.
log_errors_max_len = 1024

; 不要记录重复的信息.必须出现在同样文件的相同行之中的才被认为是重复信息,除非 ignore_repeated_source 被设为 true.
ignore_repeated_errors = Off

; 当忽略重复消息时忽略消息的来源. 当此设置打开后,不再记录来自不同文件或者不同行的相同消息.
ignore_repeated_source = Off

; 如果此选项被设置为 Off, 那么内存泄漏不会被显示 (不论在stdout还是在日志中).
; 此项仅在debug编译模式下有效, 并且错误报告需要包含 E_WARNING
report_memleaks = On

;report_zend_debug = 0

; 在$php_errormsg中保存最后一次错误/警告消息 (逻辑值).
track_errors = Off

; 关闭在错误信息中所包含的HTML标签.
; 注意: 永远不要再生产环境中使用此特性.
;html_errors = Off

; 如果html_errors 设置为On, 则PHP产生可点击的错误信息,点击后会跳转到描述此错误或者引起此错误的函数具体信息的页面.
; 你可以从 http://www.php.net/docs.php 下载一份PHP手册的副本
; 并且将 docref_root指向你放置本地拷贝的以'/'开头的.
; 你同时必须指定文件文件的包含点的扩展名.
; 注意: 永远不要再生产环境中使用此特性.
;docref_root = "/phpmanual/"
;docref_ext = .html

; 在输出的错误信息前加上的字符串.
;error_prepend_string = "<font color=#ff0000>"

; 在输出的错误信息之后加上的字符串.
;error_append_string = "</font>"

; 将错误记录到指定文件.
;error_log = filename

; 将错误记录到 syslog (NT系统上的Event Log在Windows 95下不可用).
;error_log = syslog


;;;;;;;;;;;;;;;;;
; 文件处理 ;
;;;;;;;;;;;;;;;;;
;
; 注意 - track_vars 在PHP 4.0.3 中总是打开的

; 在PHP产生的URL中用来分隔参数的符号.
; 默认是 "&".
;arg_separator.output = "&amp;"

; PHP用来将URL分割输入到变量中的分隔符.
; 默认是 "&".
; 注意: 所有包含在指令内的字符都会被认为是分隔符!
;arg_separator.input = ";&"

; 此指令描述了PHP注册GET, POST, Cookie, 环境 和 内置变量的顺序  (各自使用G, P, C, E 和 S , 一般使用 EGPCS 或 GPC).  注册使用从左往右的顺序, 新的值会覆盖旧的值.
variables_order = "EGPCS"

; 是否将EGPCS变量注册成为全局变量.
; 如果你不希望由于用户数据而导致你脚本的全局变量变得凌乱,你需要关闭此选项
; 这个一般随着 track_vars 打开 - 在这种情况下你能够通过$HTTP_*_VARS[]存取所有的GPC变量.
;
; 你应该努力写好脚本这样就不必打开register_globals
; 如果代码不是经过详细的斟酌,那将变量作为全局使用可能很容易导致潜在的安全漏洞.
register_globals = Off

; 是否注册老形式的输入数组, HTTP_GET_VARS 和相关数组
; 如果你不使用他们,建议为了提高性能关闭他们.
register_long_arrays = On

; 此指令让PHP确认是否申明 argv&argc 变量 (这些变量会包含GET信息).
; 如果你不使用这些变量,为了提升性能应该关闭此选项.
register_argc_argv = On

; 当打开此项, SERVER 和 ENV 变量将在第一次被使用时而不是脚本一开始时创建(运行时)
; 如果这些变量在脚本中没有被使用过, 打开此项会增加一点性能.
; 为了使此指令有效,PHP指令 register_globals, register_long_arrays,
; 以及 register_argc_argv 必须被关闭.
auto_globals_jit = On

; PHP可以接受的最大的POST数据大小.
post_max_size = 8M

; Magic quotes
;

; 针对GET/POST/Cookie数据打开Magic quotes.
magic_quotes_gpc = On

; 针对实时产生的数据打开Magic quotes, 例如从SQL获取的数据, 从exec()返回的数据等等.
magic_quotes_runtime = Off

; 使用 Sybase 风格的 magic quotes (使用"来引导'替代').
magic_quotes_sybase = Off

; 在任何PHP文档之前或之后自动增加文件.
auto_prepend_file =
auto_append_file =

; 和 4.0b4一样, PHP 总是使用默认在头 Content-type: 的编码输出字符.
; 将其设置为空可以禁用发送字符集.
;
; PHP内建默认为text/html
default_mimetype = "text/html"
;default_charset = "iso-8859-1"

; 总是填充 $HTTP_RAW_POST_DATA 变量.
;always_populate_raw_post_data = On


;;;;;;;;;;;;;;;;;;;;;;;;;
; 路径和目录 ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "path1;path2"
;include_path = ".;c:phpincludes"

; PHP页面的根路径, 只有非空时有效.
; 如果PHP没有使用FORCE_REDIRECT来编译, 如果你将php作为CGI运行在任何web服务器下(除了IIS)的话,你必须设置doc_root
; 针对安全问题查看文档.  一种替代方案是使用下面的cgi.force_redirect
doc_root =

; PHP使用/~username打开脚本的目录,非空时才有效.
user_dir =

; 可加载的扩展(模块)的目录位置.
extension_dir = "./"

; 是否启用 dl() 函数.  dl() 函数无法正常的在多线程服务下运行, 例如IIS或者Zeus, 并在在这些服务软件下会自动禁用.
enable_dl = On

; 在绝大多数web服务器下,cgi.force_redirect 对于提供安全执行PHP作为CGI来说是很有必要的.
; 没有配置的情况下,PHP会默认打开此项.
; 你可以在这里关闭此项并且自己承担风险
; **你可以在IIS安全的关闭此项,事实上,你必须关闭此项.**
; cgi.force_redirect = 1

; 如果 cgi.nph 被打开,就会强制CGI在每个请求时发送Status: 200.
; cgi.nph = 1

; 如果cgi.force_redirect被打开,并且你没有在Apache或者Netscape(iPlanet) web服务器下运行,
; 你也许需要设置一个环境变量名让PHP来查找让其可以获取后继续执行. 设置此变量可能引起安全问题, 在设置之前请先了解可能引起的后果.
; cgi.redirect_status_env = ;

; cgi.fix_pathinfo 为CGI提供 *真实* PATH_INFO/PATH_TRANSLATED 支持. 
; PHP的预处理行为是设置 PATH_TRANSLATED 到 SCRIPT_FILENAME, 并且不去猜测 PATH_INFO 是什么.
; 想获取关于 PATH_INFO 更多的信息, 查看 cgi 规范. 
; 将此值设置为1会引起PHP CGI修正它的路径来符合规范.
; 设置为0会引起PHP类似前面的行为. 默认是1. 你应该修正你的脚本来使用 SCRIPT_FILENAME 而不是 PATH_TRANSLATED.
; cgi.fix_pathinfo=0

; 在IIS下的FastCGI (在基于 WINNT 的操作系统下) 支持莫让呼叫客户端的安全令牌的能力.
; 这使得IIS能够定义其下运行的安全上下文.
; 在Apache下的mod_fastcgi 目前不支持此特性 (03/17/2002)
; 如果运行在IIS下设置为1. 默认是0.
; fastcgi.impersonate = 1;

; 关闭通过 FastCGI 连接的日志
; fastcgi.logging = 0

; cgi.rfc2616_headers 配置选项告知 PHP 当发送HTTP响应代码时使用什么类型的头
; 如果设置为0,PHP发送被Apache支持的 Status: 头信息.
; 当设置为1, PHP会发送 RFC2616 兼容的头信息.
; 默认为0.
; cgi.rfc2616_headers = 0


;;;;;;;;;;;;;;;;
; 文件上传 ;
;;;;;;;;;;;;;;;;

; 是否允许HTTP文件上传.
file_uploads = On

; 对于HTTP上传文件的临时文件目录 (如果没有指定则会使用系统默认).
;upload_tmp_dir =

; 允许上传的最大文件大小.
upload_max_filesize = 2M


;;;;;;;;;;;;;;;;;;
; Fopen 包装 ;
;;;;;;;;;;;;;;;;;;

; 是否允许将URL作为文件 (例如 http:// 或者 ftp://) .
allow_url_fopen = On

; 是否允许 include/require 将URL作为文件 (例如 http:// 或者 ftp://) .
allow_url_include = Off

; 定义匿名ftp密码 (你的电子邮件地址)
;from="john@doe.com"

; 定义 User-Agent 字符串
; user_agent="PHP"

; 定义基于流的socket接口的超时时间 (秒)
default_socket_timeout = 60

; 如果你的脚本必须处理从 Macintosh 系统来的文件,
; 或者你运行在一台Mac并且需要从unix或者win32系统上处理文件,
; 设置此标志会引起PHP自动检测这些文件的EOL字符,这样fgets() 和 file() 就可以不用管文件的来源而直接处理了.
; auto_detect_line_endings = Off


;;;;;;;;;;;;;;;;;;;;;;
; 动态扩展 ;
;;;;;;;;;;;;;;;;;;;;;;
;
; 如果你希望扩展自动加载, 使用下列语法:
;
;   extension=modulename.extension
;
; 例如,在Windows系统上:
;
;   extension=msql.dll
;
; ... 或者在 UNIX 下:
;
;   extension=msql.so
;
; 注意: 这里应该只是模块的名字;
; 这里不需要模块的目录信息.
; 使用上面的 extension_dir 指令来指定扩展的位置.


; Windows Extensions
; 注意:已经内建了ODBC支持,所以不需要针对ODBC的dll.
; 注意:许多DLL文件位于 extensions/ (PHP 4) 或者 ext/ (PHP 5)目录中,和分割的PECL DLL下载在一起 (PHP 5).
; 确定设置了正确的 extension_dir 指令.

;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_ifx.dll
;extension=php_imap.dll
;extension=php_interbase.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_msql.dll
;extension=php_mssql.dll
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_pdo.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_oci8.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_zip.dll

;;;;;;;;;;;;;;;;;;;
; 模块设置 ;
;;;;;;;;;;;;;;;;;;;

[Date]
; 定义date函数使用的默认时区
;date.timezone =

;date.default_latitude = 31.7667
;date.default_longitude = 35.2333

;date.sunrise_zenith = 90.583333
;date.sunset_zenith = 90.583333

[filter]
;filter.default = unsafe_raw
;filter.default_flags =

[iconv]
;iconv.input_encoding = ISO-8859-1
;iconv.internal_encoding = ISO-8859-1
;iconv.output_encoding = ISO-8859-1

[sqlite]
;sqlite.assoc_case = 0

[xmlrpc]
;xmlrpc_error_number = 0
;xmlrpc_errors = 0

[Pcre]
;PCRE 库反响追踪限制.
;pcre.backtrack_limit=100000

;PCRE 库递归限制.
;请注意如果你设置此项到一个很高的值, 你可能耗尽所有的可用的进程堆并且最终弄宕PHP(由于到达了操作系统强制的堆大小的限制).
;pcre.recursion_limit=100000

[Syslog]
; 是否定义不同的syslog变量 (例如. $LOG_PID,
; $LOG_CRON, 等等.).  关闭此选项对性能有益.
; 在运行时, 你可以调用 define_syslog_variables() 函数来定义这些变量.
define_syslog_variables  = Off

[mail function]
; 针对Win32.
SMTP = localhost
smtp_port = 25

; 针对Win32.
;sendmail_from = me@example.com

; 针对Unix.  可以支持参数 (默认: "sendmail -t -i").
;sendmail_path =

; 强制额外的指定的参数被作为扩展参数传送给sendmail执行文件.
; 这些参数总是替代mail()函数的第五个参数值, 甚至是在安全模式内.
;mail.force_extra_parameters =

[SQL]
sql.safe_mode = Off

[ODBC]
;odbc.default_db    =  目前无效
;odbc.default_user  =  目前无效
;odbc.default_pw    =  目前无效

; 允许或阻止持久连接.
odbc.allow_persistent = On

; 在重用前检查连接是否可用.
odbc.check_persistent = On

; 持久连接的最大数目.  -1 意味着没有限制.
odbc.max_persistent = -1

; 最大连接数 (持久 + 非持久).  -1 意味着没有限制.
odbc.max_links = -1

; 长字段处理.  返回变量的字节数.  0 意味着略过.
odbc.defaultlrl = 4096

; 二进制数据处理. 0 意味着略过, 1按照实际返回, 2 转换到字符.
; 查看 odbc_binmode 和 odbc_longreadlen 的文档来获取针对 uodbc.defaultlrl 和 uodbc.defaultbinmode的解释
odbc.defaultbinmode = 1

[MySQL]
; 允许或阻止持久连接.
mysql.allow_persistent = On

; 持久连接的最大数目.  -1 意味着没有限制.
mysql.max_persistent = -1

; 最大连接数 (持久 + 非持久).  -1 意味着没有限制.
mysql.max_links = -1

; mysql_connect()默认的端口号.  如果没有设置, mysql_connect() 会使用 $MYSQL_TCP_PORT
; 或者 位于/etc/services的 mysql-tcp 入口或者编译时定义的MYSQL_PORT 值(按照此顺序查找).
; Win32 只会查找MYSQL_PORT值.
mysql.default_port =

; 对于本地MySQL连接的默认socket名称. 如果为空, 则使用MySQL内建默认值.
mysql.default_socket =

; mysql_connect() 的默认host值(在安全模式中不会生效).
mysql.default_host =

; mysql_connect() 的默认user值(在安全模式中不会生效).
mysql.default_user =

; mysql_connect() 的默认password值(在安全模式中不会生效).
; 注意在此文件中保存密码一般来说是 *糟糕* 的主义.
; *任何* 使用PHP的用户可以执行 'echo get_cfg_var("mysql.default_password")
; 并且获取到此密码! 而且理所当然, 任何有对此文件读权限的用户都可以获取到此密码.
mysql.default_password =

; 连接超时的最大时间 (秒) , -1 意味着没有限制.
mysql.connect_timeout = 60

; 追踪模式. 当 trace_mode 被打开 (=On), table/index 扫描的警告和SQL错误会被显示出来.
mysql.trace_mode = Off

[MySQLi]

; 最大连接数.  -1 意味着没有限制.
mysqli.max_links = -1

; mysqli_connect()默认的端口号.  如果没有设置, mysql_connect() 会使用 $MYSQL_TCP_PORT
; 或者 位于/etc/services的 mysql-tcp 入口或者编译时定义的MYSQL_PORT 值(按照此顺序查找).
; Win32 只会查找MYSQL_PORT值.
mysqli.default_port = 3306

; 对于本地MySQL连接的默认socket名称. 如果为空, 则使用MySQL内建默认值.
mysqli.default_socket =

; mysqli_connect() 的默认host值(在安全模式中不会生效).
mysqli.default_host =

; mysqli_connect() 的默认user值(在安全模式中不会生效).
mysqli.default_user =

; mysqli_connect() 的默认password值(在安全模式中不会生效).
; 注意在此文件中保存密码一般来说是 *糟糕* 的主义.
; *任何* 使用PHP的用户可以执行 'echo get_cfg_var("mysqli.default_password")
; 并且获取到此密码! 而且理所当然, 任何有对此文件读权限的用户都可以获取到此密码.
mysqli.default_pw =

; 允许或阻止持久连接.
mysqli.reconnect = Off

[mSQL]
; 允许或阻止持久连接.
msql.allow_persistent = On

; 持久连接的最大数目.  -1 意味着没有限制.
msql.max_persistent = -1

; 最大连接数 (持久 + 非持久).  -1 意味着没有限制.
msql.max_links = -1

[OCI8]
; 打开使用外部认证的授权连接 (OCI_SYSOPER, OCI_SYSDBA)
;oci8.privileged_connect = Off

; 连接: 每个进程的持久OCI8连接的最大数, -1 意味着没有限制.
;oci8.max_persistent = -1

; 连接: 一个进程允许保持一个空闲持久连接的最大秒数.
; -1意味着空闲持久连接会永远被保持.
;oci8.persistent_timeout = -1

; 连接: 当oci_pconnect() 检测一个连接是否有效时每次发起ping之间必须通过的秒数.
; 当设置为0后, 每个oci_pconnect() 会发起一个ping. Using -1 完全关闭ping.
;oci8.ping_interval = 60

; 调优: 此选项打开声明缓冲(statement cache), 并且指定缓冲多少声明. 使用0关闭声明缓冲.
;oci8.statement_cache_size = 20

; 调优: 打开声明预取(statement prefetch) 并且设置自动在声明执行后被取到行的数量.
;oci8.default_prefetch = 10

; 兼容性: 设置为On 意味着 oci_close() 不会关闭 oci_connect() 和 oci_new_connect() 的连接.
;oci8.old_oci_close_semantics = Off

[PostgresSQL]
; 允许或阻止持久连接.
pgsql.allow_persistent = On

; 总是在 pg_pconnect() 时检测断开的持久连接.
; 自动重置特性会引起一点开销.
pgsql.auto_reset_persistent = Off

; 持久连接的最大数目.  -1 意味着没有限制.
pgsql.max_persistent = -1

; 最大连接数 (持久 + 非持久).  -1 意味着没有限制.
pgsql.max_links = -1

; 是否忽略 PostgreSQL 后端通告消息.
; 通告消息记录会需要一点开销.
pgsql.ignore_notice = 0

; 是否记录 PostgreSQL 后端通告消息.
; 除非 pgsql.ignore_notice=0, 否则模块无法记录通告消息
pgsql.log_notice = 0

[Sybase]
; 允许或阻止持久连接.
sybase.allow_persistent = On

; 持久连接的最大数目.  -1 意味着没有限制.
sybase.max_persistent = -1

; 最大连接数 (持久 + 非持久).  -1 意味着没有限制.
sybase.max_links = -1

;sybase.interface_file = "/usr/sybase/interfaces"

; 显示出的消息最小严重程度.
sybase.min_error_severity = 10

; 显示出的消息最小严重程度.
sybase.min_message_severity = 10

; 兼容老版本PHP 3.0的模式.
; 如果设为 on, 会引起 PHP 自动绑定结果记录的类型到Sybase的类型,而不是将他们全部按照字符串处理.
; 此兼容模式可能不会永久存在, 所以最好尝试在你代码中需要的地方作出必要的修改, 然后关闭此选项.
sybase.compatability_mode = Off

[Sybase-CT]
; 允许或阻止持久连接.
sybct.allow_persistent = On

; 持久连接的最大数目.  -1 意味着没有限制.
sybct.max_persistent = -1

; 最大连接数 (持久 + 非持久).  -1 意味着没有限制.
sybct.max_links = -1

; 显示出的错误最小严重程度.
sybct.min_server_severity = 10

; 显示出的消息最小严重程度.
sybct.min_client_severity = 10

[bcmath]
; 所有bcmath函数的小数位数
bcmath.scale = 0

[browscap]
;browscap = extra/browscap.ini

[Informix]
; 对于 ifx_connect() 的默认host (不会在安全模式被应用).
ifx.default_host =

; 对于 ifx_connect() 的默认user (不会在安全模式被应用).
ifx.default_user =

; 对于 ifx_connect() 的默认password (不会在安全模式被应用).
ifx.default_password =

; 允许或阻止持久连接.
ifx.allow_persistent = On

; 持久连接的最大数目.  -1 意味着没有限制.
ifx.max_persistent = -1

; 最大连接数 (持久 + 非持久).  -1 意味着没有限制.
ifx.max_links = -1

; 如果设为 on, select 声明返回 text 段的内容而不是它的id.
ifx.textasvarchar = 0

; 如果设为 on, select 声明返回 byte 段的内容而不是它的id.
ifx.byteasvarchar = 0

; 固定长度字符列的尾部空格会被截去.  可能对 Informix SE 用户有帮助.
ifx.charasvarchar = 0

; 如果设为 on, text 和 byte 段会被dump到一个文件而不是在内存中保留它们.
ifx.blobinfile = 0

; NULL会被作为一个空字符串返回, 除非被设为1. 如果设为1, NULL会被作为字符串'NULL'返回.
ifx.nullformat = 0

[Session]
; 用来存储/获取数据的处理方法.
session.save_handler = files

; 传送到save_handler的参数.  在使用文件的情况下, 这里是数据文件被保存的路径.
; 注意: Windows 用户必须改变此值来使用PHP的会话函数.
;
; 和在 4.0.1一样, 你可以定义如下路径:
;
;     session.save_path = "N;/path"
;
; 这里的 N 是一个整数.  使用此参数会在目录内建立一个N层深度的子目录用来保存session文件,
; 而不是将所有session文件保存在同一个/path目录内. 
; 这对你或当你的操作系统在一个目录内保存太多文件时出现问题很有帮助.
; 并且对于处理大量session的服务器提供更高的效率.
;
; 注意 1: PHP不会自动创建目录结构. 你可以使用在ext/session目录内的脚本来创建目录结构.
; 注意 2: 如果你选择使用子目录来保存session,请检查下面关于垃圾回收的配置段
;
; 文件存储模块默认使用600模式来创建文件,在使用中你可以改变此选项
;
;     session.save_path = "N;MODE;/path"
;
; 这里的MODE由8进制来表示. 注意这里不会覆盖进程的umask.
;session.save_path = "/tmp"

; 是否使用cookie.
session.use_cookies = 1

;session.cookie_secure =

; 这个选项允许管理员去保护那些在URL中传送session id的用户免于被攻击
; 默认是 0.
; session.use_only_cookies = 1

; session的名称 (作为cookie名称来使用).
session.name = PHPSESSID

; 在请求开始的时候初始化session.
session.auto_start = 0

; cookie的生存秒数,或者如果为0就直到浏览器重启.
session.cookie_lifetime = 0

; cookie有效的路径.
session.cookie_path = /

; cookie有效的域名.
session.cookie_domain =

; 是否将httpOnly标志增加到cookie上, 增加后则cookie无法被浏览器的脚本语言(例如JavaScript)存取.
session.cookie_httponly =

; 用于序列化数据的处理器. php是标准的PHP序列化器.
session.serialize_handler = php

; 定义'垃圾回收'进程在每次session初始化时开始的比例.
; 比例由 gc_probability/gc_divisor来得出,
; 例如. 1/100 意味着在每次请求时有1%的机会启动'垃圾回收'进程.

session.gc_probability = 1
session.gc_divisor     = 100

; 在经过以下秒数之后, 存储的数据会被认为是'垃圾'并且被垃圾回收进程清理掉.
session.gc_maxlifetime = 1440

; 注意: 如果你使用子目录选项来保存session文件
;       (查看在上面的session.save_path), 那么垃圾回收就 *不会* 自动发生.
;       你需要通过一个shell脚本,cron或者其他方法来自行处理垃圾回收.
;       例如, 下面的脚本相当于将session.gc_maxlifetime设置为 1440 (1440 秒 = 24 分钟):
;          cd /path/to/sessions; find -cmin +24 | xargs rm

; PHP 4.2 和更早版本有一个未公开的 特性/bug , 此特性允许你在全局初始化一个session变量,即便 register_globals 已经被关闭.
; 如果此特性被使用,PHP 4.3 和更早版本会警告你.
; 你可以关闭此特性并且隔离此警告. 这时候,如果打开bug_compat_42,那此警告只是被显示出来.

session.bug_compat_42 = 1
session.bug_compat_warn = 1

; 检查HTTP Referer来防止带有id的外部URL.
; HTTP_REFERER 必须包含从session来的这个字段才会被认为是合法的.
session.referer_check =

; 从此文件读取多少字节.
session.entropy_length = 0

; 在这里指定创建session id.
session.entropy_file =

;session.entropy_length = 16

;session.entropy_file = /dev/urandom

; 设置为 {nocache,private,public,} 来决定HTTP缓冲的类型
; 留空则防止发送 anti-caching 头.
session.cache_limiter = nocache

; 文档在n分钟之后过期.
session.cache_expire = 180

; trans sid 支持默认关闭.
; 使用 trans sid 可能让你的用户承担安全风险.
; 使用此项必须小心.
; - 用户也许通过email/irc/其他途径发送包含有效的session ID的URL给其他人.
; - 包含有效session ID的URL可能被存放在容易被公共存取的电脑上.
; - 用户可能通过在浏览器历史记录或者收藏夹里面的包含相同的session ID的URL来访问你的站点.
session.use_trans_sid = 0

; 选择hash方法
; 0: MD5   (128 bits)
; 1: SHA-1 (160 bits)
session.hash_function = 0

; 当转换二进制hash数据到可读形式时,每个字符保存时有几位.
;
; 4 bits: 0-9, a-f
; 5 bits: 0-9, a-v
; 6 bits: 0-9, a-z, A-Z, "-", ","
session.hash_bits_per_character = 4

; URL rewriter会在已经定义的一组HTML标签内查找URL.
; form/fieldset 是特殊字符; 如果你在这里包含他们, rewriter会增加一个包含信息的隐藏<input>字段否则就是在URL中附加信息.
; 如果你你想遵守XHTML, 删除form的入口.
; 注意 所有合法的入口都需要一个"="符号, 甚至是没有任何值的.
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

[MSSQL]
; 允许或阻止持久连接.
mssql.allow_persistent = On

; 持久连接的最大数目.  -1 意味着没有限制.
mssql.max_persistent = -1

; 最大连接数 (持久 + 非持久).  -1 意味着没有限制.
mssql.max_links = -1

; 显示出的错误最小严重程度.
mssql.min_error_severity = 10

; 显示出的消息最小严重程度.
mssql.min_message_severity = 10

; PHP 3.0 老版本的兼容模式.
mssql.compatability_mode = Off

; 连接超时
;mssql.connect_timeout = 5

; 查询超时
;mssql.timeout = 60

; 有效范围 0 - 2147483647.  默认 = 4096.
;mssql.textlimit = 4096

; 有效范围 0 - 2147483647.  默认 = 4096.
;mssql.textsize = 4096

; 每批记录的数量限制.  0 = 所有记录在一批内.
;mssql.batchsize = 0

; 指定 datetime 和 datetim4 栏如何返回
; On => 返回数据转换到SQL服务器设置的格式
; Off => 使用 YYYY-MM-DD hh:mm:ss 返回
;mssql.datetimeconvert = On

; 当连接到服务器时使用NT验证
mssql.secure_connection = Off

; 指定最大进程数. -1 = 库默认
; msdlib 默认 25
; FreeTDS 默认 4096
;mssql.max_procs = -1

; 指定客户端字符集.
; 如果为空或者没有指定,客户端字符集将会使用freetds.conf的配置
; 只有和FreeTDS编译时会被使用
;mssql.charset = "ISO-8859-1"

[Assertion]
; 断言(expr); 默认打开.
;assert.active = On

; 对于每个失败断言发起一个PHP警告.
;assert.warning = On

; 默认不要保释.
;assert.bail = Off

; 如果断言失败则调用用户自定义函数.
;assert.callback = 0

; 使用当前 error_reporting() Eval一个表达式.  如果你想要在eval()附近error_reporting(0) ,那设置为true.
;assert.quiet_eval = 0

[COM]
; 包含GUID,IID或者TypeLibs的文件的文件名的文件的路径
;com.typelib_file =
; 允许 Distributed-COM 调用
;com.allow_dcom = true
; 自动注册位于com_load()函数的组件typlib的常量
;com.autoregister_typelib = true
; 注册常量大小写敏感
;com.autoregister_casesensitive = false
; 当有重复常量注册时显示警告
;com.autoregister_verbose = true

[mbstring]
; 内部字符表示的语言.
;mbstring.language = Japanese

; 内部/脚本编码.
; 部分编码无法作为内部编码使用.
; (例如. SJIS, BIG5, ISO-2022-*)
;mbstring.internal_encoding = EUC-JP

; http 输入编码.
;mbstring.http_input = auto

; http 输出编码. mb_output_handler 必须作为函数被注册为输出缓冲
;mbstring.http_output = SJIS

; 按照mbstring.internal_encoding的设置打开自动编码转换
; 当设置为On时,输入字符被转换为内部编码.
; 注意: 不要针对可移植库/应用使用自动编码转换.
;mbstring.encoding_translation = Off

; 自动编码检测序列
; 自动意味着
;mbstring.detect_order = auto

; 当无法将字符从一种转换到另一种时使用的置换符号
;mbstring.substitute_character = none;

; 使用mbstring函数 覆盖(替换) 单字节函数.
; mail(), ereg(), 等等都会被 mb_send_mail(), mb_ereg() 等等覆盖,
; 可以取的值是 0,1,2,4 或者他们的组合.
; 例如, 7 就是覆盖所有函数.
; 0: 不覆盖
; 1: 覆盖 mail() 函数
; 2: 覆盖 str*() 函数
; 4: 覆盖 ereg*() 函数
;mbstring.func_overload = 0

[FrontBase]
;fbsql.allow_persistent = On
;fbsql.autocommit = On
;fbsql.show_timestamp_decimals = Off
;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

[gd]
; 告知jpeg解码器libjpeg警告并且尝试创建一个gd图像. 此警告会被作为一个通告显示
; 默认为关闭
;gd.jpeg_ignore_warning = 0

[exif]
; Exif UNICODE 用户注释会被作为UCS-2BE/UCS-2LE 和 JIS 来进行 JIS处理.
; 当 mbstring.internal_encoding 设置为空,如果有 mbstring 支持,则会自动转换到给出的对应编码设置的编码.
; 对于解码设置你可以在motorola和intel字符序列上进行选择. 解码设置不能设置为空.
;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    = JIS

[Tidy]
; 当调用tidy时,默认指向tidy配置文件的路径
;tidy.default_config = /usr/local/lib/php/default.tcfg

; tidy是否自动清除和修复输出?
; 警告: 不要在你产生非html内容时使用此项,例如产生动态图片时
tidy.clean_output = Off

[soap]
; 打开或关闭WSDL缓冲特性.
soap.wsdl_cache_enabled=1
; 设置SOAP扩展存放缓冲文件的目录.
soap.wsdl_cache_dir="/tmp"
; (存活时间) 设置当缓冲文件被用来替换原有缓冲文件的秒数.
soap.wsdl_cache_ttl=86400

; Local Variables:
; tab-width: 4
; End:

 

下载的apache要记得下OPENSSL的
httpd-2.2.19-win32-x86-openssl-0.9.8r.msi
下载的PHP记得下线程安全的,这样才便于搭建http服务
php教程-5.2.17-Win32-VC6-x86.msi
下面就是转载的了
 
此文章的安装方法适用于Windows XP下的Apache+PHP+MySQL安装,同时也适用于Windows 2003系统下的安装和配置。
1. 安装环境
操作系统是 Windows XP 中文版, Apache, PHP, MySQL 的最新版本是截止到 2007.09.07,分别在其官网下载的:
* Apache 2.2.6:http://apache.mirror.111cn.net/httpd/binaries/win32/
* PHP 5.2.4 (Windows Binaries PHP 5.2.4 zip package): http://www.php.net/downloads.php
* MySQL 5.0.45 Windonws: http://dev.mysql教程.com/downloads/
2. 安装的目录结构规划
为了方便维护,可以将服务器软件安装在系统盘(C盘)而把自己的文件定位到其他盘,这样对于以后的维护很重要。
3. 在 Windows XP 下安装 Apache 2.2.6
Windows XP 下的安装
1. 运行 apache 2.2.6 的安装程序,根据提示一路 Next 即可。在 Server Information 的 Network Domain、Server Name 字段随便填上一个域名即可,如php.com,然后根据提示一路 Next 完成即可。
2. 在安装结束时,会弹出一个 DOS 窗口,然后就消失了,这是系统apache自动启动了。
4. 在 Windows XP 下安装 php 5.2.4
1. 将下载的 php 5 ZIP 包直接解压,我直接将 PHP 5.2.4 zip 文件解压到 d:php 目录下面。安装 php 不建议使用 win32 安装程序(主要是以后安装扩展麻烦)。
2. 在资源管理器中进入 php 的安装目录,将 php.ini-dist 或 php.ini-recommended 复制一份,命名为 php.ini。然后打开 php.ini。
3. 找到:
;extension=php_mysql.dll
将前面的 ; 号去掉, 改成:
extension=php_mysql.dll
4. 找到:
extension_dir = “./”
将其改为你的 php 安装目录下 ext 子目录的绝对路径。例如我的:
extension_dir = “D:/php/ext/”
这步很重要 。否则接下来 php 会找不到 php_mysql.dll 模块,无法装载。
5. 在“控制面板”->“系统”->“高级”->“环境变量”,在“系统变量”里面找到path,编辑path的变量值,添加你的php目录D:php,前面一定要用分号(;)把它和前面的值分开。 
5. 配置 Apache 和 PHP
打开 Apache 安装目录下的 conf 子目录中的 httpd.conf 文件。
1. 找到:
DocumentRoot “xxxxxxx”
改成你本机的网站内容的目录。例如我的:
DocumentRoot “E:/web”
改完之后往下稍微拉动一下,找到“# This should be changed to whatever you set DocumentRoot to.”,然后把下面这个地方也改过来
<Directory “E:/web”>
2. 找到 LoadModule,根据你的 php 安装目录,在下面空白处加上这两行:
LoadModule php5_module “D:/PHP/php5apache2_2.dll”
PHPIniDir “D:/PHP”这个不要了,免得apache服务器启动不起
3. 找到:
DirectoryIndex index.html
修改为:
DirectoryIndex index.php index.html
4. 找到:
AddType application/x-gzip .gz .tgz
添加这两行:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
5. 保存 httpd.conf
6. 在你的网站目录中(例如我的是 E:/Web/),手工建立一个 index.php 的文件,内容:
<?php
phpinfo();
?>
7. 在 dos 窗口中启动 apache 服务(假设Apache安装在了C:Program FilesApache Software FoundationApache2.2)
#如果之前启动了,先将其 stop
C:Program FilesApache Software FoundationApache2.2bin> httpd -k stop
或者是:net stop apache2.2
#启动 apahce 服务
C:Program FilesApache Software FoundationApache2.2bin> httpd -k start
或者是:net start apache2.2
8. 打开 http://localhost/index.php,即可看到测试输出结果。
6. Windows XP 下安装 MySQL 5.0.45
MySQL 的安装比较简单,它提供了一个 win32 的安装包。下载后根据提示一路安装,也可以在安装类型处选 Custom,指定安装目录,这里直接默认安装在了C盘。
安装完成后,会问你要不要到官网注册,跳过即可。然后会问你是否 Configure the MySQL Server now,选中并继续,然后根据提示,设定 字符集,以及 root 管理员的密码即可。

Ubuntu上搭建PHP+Mysql+Nginx环境(apt-get方式)

ubuntu版本:Ubuntu 10.04 LTS

1、首先使用apt-get下载Nginx,php教程,mysql教程,phpmyadmin,spawn-fcgi。

sudo apt-get install nginx php5-cgi php5-cli mysql-server-5.1 phpmyadmin  spawn-fcgi

期间可能要输入mysql的密码,按照提示一步一步安装就是了。

OK后,你在Firefox中访问http://127.0.0.1/或者http://localhost/应该就能看见Nginx的欢迎界面了。

2、此时Nginx并不能跑PHP程序。需要修改一些配置文件。

$ cd /etc/nginx

$ sudo vim fastcgi_params,修改如下(红色部分):

fastcgi_ignore_client_abort  on;
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;

fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_FILENAME      $document_root$fastcgi_script_name;
fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

修改Nginx 配置文件nginx.conf

sudo vim nginx.conf,最后如下:

user codebean codebean;  #用户和用户组
worker_processes  2;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
    # multi_accept on;
}

http {
    include       /etc/nginx/mime.types;

    access_log    /var/log/nginx/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;
    gzip_disable "MSIE [1-6].(?!.*SV1)";

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

3、接下来我们来配置一个默认站点:

cd /etc/nginx/sites-available

sudo vim default

修改后如下:

server {
    listen   80 default;  #default表示是默认站点
    server_name  localhost;   #访问的名称
    root   /var/www/nginx-default; #网站根目录

    access_log  /var/log/nginx/localhost.access.log;

    location / {       
        index  index.php index.html index.htm;
    }

    location ~ .php$ {
        include fastcgi_params;  #这个很重要
    }

}

接下来你在目录/var/www/nginx-default新建一个index.php,输入:

phpinfo();然后重启nginx服务和开启fastcgi:

$ sudo /etc/init.d/nginx restart
$ /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 /usr/bin/php-cgi

再访问http://127.0.0.1/或者http://localhost/看看

 

[!--infotagslink--]

相关文章