Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 05cd670d8a02b2b4a0ffb1756f2e8308 > files > 9279

php-manual-zh-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>putenv</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PHP 手册"
HREF="index.html"><LINK
REL="UP"
TITLE="PHP Options&Information"
HREF="ref.info.html"><LINK
REL="PREVIOUS"
TITLE="phpversion"
HREF="function.phpversion.html"><LINK
REL="NEXT"
TITLE="restore_include_path"
HREF="function.restore-include-path.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP 手册</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.phpversion.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.restore-include-path.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.putenv"
></A
>putenv</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN182288"
></A
><P
>    (PHP 3, PHP 4, PHP 5)</P
>putenv&nbsp;--&nbsp;Sets the value of an environment variable</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN182291"
></A
><H2
>说明</H2
>bool <B
CLASS="methodname"
>putenv</B
> ( string setting )<BR
></BR
><P
>&#13;   Adds <CODE
CLASS="parameter"
>setting</CODE
> to the server environment.  The
   environment variable will only exist for the duration of the current
   request. At the end of the request the environment is restored to its
   original state.
  </P
><P
>&#13;   Setting certain environment variables may be a potential security breach.
   The <TT
CLASS="literal"
>safe_mode_allowed_env_vars</TT
> 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 by
   this directive. By default, users will only be able to set environment
   variables that begin with <TT
CLASS="literal"
>PHP_</TT
> (e.g.
   <TT
CLASS="literal"
>PHP_FOO=BAR</TT
>). Note: if this directive is empty, PHP
   will let the user modify ANY environment variable!
  </P
><P
>&#13;   The <TT
CLASS="literal"
>safe_mode_protected_env_vars</TT
> directive contains a
   comma-delimited list of environment variables, that the end user won't be
   able to change using <B
CLASS="function"
>putenv()</B
>.  These variables will
   be protected even if <TT
CLASS="literal"
>safe_mode_allowed_env_vars</TT
> is set
   to allow to change them.
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN182309"
></A
><H2
>参数</H2
><P
>&#13;   <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><CODE
CLASS="parameter"
>setting</CODE
></DT
><DD
><P
>&#13;       The setting, like <TT
CLASS="literal"
>"FOO=BAR"</TT
>
      </P
></DD
></DL
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN182319"
></A
><H2
>返回值</H2
><P
>&#13;   如果成功则返回 <TT
CLASS="constant"
><B
>TRUE</B
></TT
>,失败则返回 <TT
CLASS="constant"
><B
>FALSE</B
></TT
>。
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN182324"
></A
><H2
>范例</H2
><P
>&#13;   <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN182327"
></A
><P
><B
>例 1. Setting an environment variable</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br />putenv</font><font color="#007700">(</font><font color="#DD0000">"UNIQID=$uniqid"</font><font color="#007700">);<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN182330"
></A
><H2
>注释</H2
><DIV
CLASS="warning"
><P
></P
><TABLE
CLASS="warning"
BORDER="1"
WIDTH="100%"
><TR
><TD
ALIGN="CENTER"
><B
>警告</B
></TD
></TR
><TR
><TD
ALIGN="LEFT"
><P
>&#13;    These directives have only effect when <A
HREF="features.safe-mode.html"
>safe-mode</A
> itself is enabled!
   </P
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN182335"
></A
><H2
>参见</H2
><P
>&#13;   <P
></P
><TABLE
BORDER="0"
><TBODY
><TR
><TD
><A
HREF="function.getenv.html"
><B
CLASS="function"
>getenv()</B
></A
></TD
></TR
></TBODY
></TABLE
><P
></P
>
  </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.phpversion.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>起始页</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.restore-include-path.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>phpversion</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.info.html"
ACCESSKEY="U"
>上一级</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>restore_include_path</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>