Sophie

Sophie

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

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
>Network Functions</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PHP 手册"
HREF="index.html"><LINK
REL="UP"
TITLE="函数参考"
HREF="funcref.html"><LINK
REL="PREVIOUS"
TITLE="ncurses_wvline"
HREF="function.ncurses-wvline.html"><LINK
REL="NEXT"
TITLE="checkdnsrr"
HREF="function.checkdnsrr.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="reference"
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.ncurses-wvline.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.checkdnsrr.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="reference"
><A
NAME="ref.network"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="title"
>CII. Network Functions</H1
><DIV
CLASS="PARTINTRO"
><A
NAME="AEN148459"
></A
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="network.intro"
>简介</A
></H1
><P
>&#13;    
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="network.requirements"
>需求</A
></H1
><P
>要编译本扩展模块无需外部库文件。</P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="network.installation"
>安装</A
></H1
><P
>本扩展模块作为 PHP 内核的一部分,无需安装即可使用。</P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="network.configuration"
>运行时配置</A
></H1
><P
>这些函数的行为受 <TT
CLASS="filename"
>php.ini</TT
> 的影响。</P
><P
>&#13;  <DIV
CLASS="table"
><A
NAME="AEN148474"
></A
><P
><B
>表 1. Network Configuration Options</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><COL><COL><COL><THEAD
><TR
><TH
>Name</TH
><TH
>Default</TH
><TH
>Changeable</TH
><TH
>Changelog</TH
></TR
></THEAD
><TBODY
><TR
><TD
>define_syslog_variables</TD
><TD
>"0"</TD
><TD
>PHP_INI_ALL</TD
><TD
>&nbsp;</TD
></TR
></TBODY
></TABLE
></DIV
>
 有关 PHP_INI_* 常量进一步的细节与定义参见<A
HREF="ini.html"
>附录 H</A
>。
 </P
><P
>以下是配置选项的简要解释。</P
><P
>&#13; <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><A
NAME="ini.define-syslog-variables"
></A
><CODE
CLASS="parameter"
>define_syslog_variables</CODE
>
   <A
HREF="language.types.boolean.html"
><B
CLASS="type"
>boolean</B
></A
></DT
><DD
><P
>&#13;     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. At
     runtime, you can define these variables by calling
     <A
HREF="function.define-syslog-variables.html"
><B
CLASS="function"
>define_syslog_variables()</B
></A
>.
    </P
></DD
></DL
></DIV
>
 </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="network.resources"
>资源类型</A
></H1
><P
>&#13;     This extension defines a file pointer resource returned by
     <A
HREF="function.fsockopen.html"
><B
CLASS="function"
>fsockopen()</B
></A
> and <A
HREF="function.pfsockopen.html"
><B
CLASS="function"
>pfsockopen()</B
></A
>.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="network.constants"
>预定义常量</A
></H1
><P
>以下常量作为 PHP 核心的一部分一直有效。</P
><DIV
CLASS="table"
><A
NAME="AEN148508"
></A
><P
><B
>表 2. <A
HREF="function.openlog.html"
><B
CLASS="function"
>openlog()</B
></A
> Options</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><COL><THEAD
><TR
><TH
>Constant</TH
><TH
>Description</TH
></TR
></THEAD
><TBODY
><TR
><TD
>LOG_CONS</TD
><TD
>&#13;       if there is an error while sending data to the system logger,
       write directly to the system console
      </TD
></TR
><TR
><TD
>LOG_NDELAY</TD
><TD
>&#13;       open the connection to the logger immediately 
      </TD
></TR
><TR
><TD
>LOG_ODELAY</TD
><TD
>&#13;       (default) delay opening the connection until the first
       message is logged
      </TD
></TR
><TR
><TD
>LOG_NOWAIT</TD
><TD
>&nbsp;</TD
></TR
><TR
><TD
>LOG_PERROR</TD
><TD
>print log message also to standard error</TD
></TR
><TR
><TD
>LOG_PID</TD
><TD
>include PID with each message</TD
></TR
></TBODY
></TABLE
></DIV
><DIV
CLASS="table"
><A
NAME="AEN148535"
></A
><P
><B
>表 3. <A
HREF="function.openlog.html"
><B
CLASS="function"
>openlog()</B
></A
> Facilities</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><COL><THEAD
><TR
><TH
>Constant</TH
><TH
>Description</TH
></TR
></THEAD
><TBODY
><TR
><TD
>LOG_AUTH</TD
><TD
>&#13;       security/authorization messages (use LOG_AUTHPRIV instead
       in systems where that constant is defined)
      </TD
></TR
><TR
><TD
>LOG_AUTHPRIV</TD
><TD
>security/authorization messages (private)</TD
></TR
><TR
><TD
>LOG_CRON</TD
><TD
>clock daemon (cron and at)</TD
></TR
><TR
><TD
>LOG_DAEMON</TD
><TD
>other system daemons</TD
></TR
><TR
><TD
>LOG_KERN</TD
><TD
>kernel messages</TD
></TR
><TR
><TD
>LOG_LOCAL0 ... LOG_LOCAL7</TD
><TD
>reserved for local use, these are not available in Windows</TD
></TR
><TR
><TD
>LOG_LPR</TD
><TD
>line printer subsystem</TD
></TR
><TR
><TD
>LOG_MAIL</TD
><TD
>mail subsystem</TD
></TR
><TR
><TD
>LOG_NEWS</TD
><TD
>USENET news subsystem</TD
></TR
><TR
><TD
>LOG_SYSLOG</TD
><TD
>messages generated internally by syslogd</TD
></TR
><TR
><TD
>LOG_USER</TD
><TD
>generic user-level messages</TD
></TR
><TR
><TD
>LOG_UUCP</TD
><TD
>UUCP subsystem</TD
></TR
></TBODY
></TABLE
></DIV
><DIV
CLASS="table"
><A
NAME="AEN148580"
></A
><P
><B
>表 4. <A
HREF="function.syslog.html"
><B
CLASS="function"
>syslog()</B
></A
> Priorities (in descending order)</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><COL><THEAD
><TR
><TH
>Constant</TH
><TH
>Description</TH
></TR
></THEAD
><TBODY
><TR
><TD
>LOG_EMERG</TD
><TD
>system is unusable</TD
></TR
><TR
><TD
>LOG_ALERT</TD
><TD
>action must be taken immediately</TD
></TR
><TR
><TD
>LOG_CRIT</TD
><TD
>critical conditions</TD
></TR
><TR
><TD
>LOG_ERR</TD
><TD
>error conditions</TD
></TR
><TR
><TD
>LOG_WARNING</TD
><TD
>warning conditions</TD
></TR
><TR
><TD
>LOG_NOTICE</TD
><TD
>normal, but significant, condition</TD
></TR
><TR
><TD
>LOG_INFO</TD
><TD
>informational message</TD
></TR
><TR
><TD
>LOG_DEBUG</TD
><TD
>debug-level message</TD
></TR
></TBODY
></TABLE
></DIV
><DIV
CLASS="table"
><A
NAME="AEN148613"
></A
><P
><B
>表 5. <A
HREF="function.dns-get-record.html"
><B
CLASS="function"
>dns_get_record()</B
></A
> Options</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><COL><THEAD
><TR
><TH
>Constant</TH
><TH
>Description</TH
></TR
></THEAD
><TBODY
><TR
><TD
>DNS_A</TD
><TD
>IPv4 Address Resource</TD
></TR
><TR
><TD
>DNS_MX</TD
><TD
>Mail Exchanger Resource</TD
></TR
><TR
><TD
>DNS_CNAME</TD
><TD
>Alias (Canonical Name) Resource</TD
></TR
><TR
><TD
>DNS_NS</TD
><TD
>Authoritative Name Server Resource</TD
></TR
><TR
><TD
>DNS_PTR</TD
><TD
>Pointer Resource</TD
></TR
><TR
><TD
>DNS_HINFO</TD
><TD
>Host Info Resource (See IANA's
        <A
HREF="http://www.iana.org/assignments/operating-system-names"
TARGET="_top"
>Operating System Names</A
>
        for the meaning of these values)</TD
></TR
><TR
><TD
>DNS_SOA</TD
><TD
>Start of Authority Resource</TD
></TR
><TR
><TD
>DNS_TXT</TD
><TD
>Text Resource</TD
></TR
><TR
><TD
>DNS_ANY</TD
><TD
>Any Resource Record.  On most systems
        this returns all resource records, however
        it should not be counted upon for critical
        uses.  Try DNS_ALL instead.</TD
></TR
><TR
><TD
>DNS_AAAA</TD
><TD
>IPv6 Address Resource</TD
></TR
><TR
><TD
>DNS_ALL</TD
><TD
>Iteratively query the name server for
        each available record type.</TD
></TR
></TBODY
></TABLE
></DIV
></DIV
></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>目录</B
></DT
><DT
><A
HREF="function.checkdnsrr.html"
>checkdnsrr</A
>&nbsp;--&nbsp;
     Check DNS records corresponding to a given Internet host name or
     IP address
    </DT
><DT
><A
HREF="function.closelog.html"
>closelog</A
>&nbsp;--&nbsp;Close connection to system logger</DT
><DT
><A
HREF="function.debugger-off.html"
>debugger_off</A
>&nbsp;--&nbsp;Disable internal PHP debugger (PHP 3)</DT
><DT
><A
HREF="function.debugger-on.html"
>debugger_on</A
>&nbsp;--&nbsp;Enable internal PHP debugger (PHP 3)</DT
><DT
><A
HREF="function.define-syslog-variables.html"
>define_syslog_variables</A
>&nbsp;--&nbsp;Initializes all syslog related constants</DT
><DT
><A
HREF="function.dns-check-record.html"
>dns_check_record</A
>&nbsp;--&nbsp;Synonym for <A
HREF="function.checkdnsrr.html"
><B
CLASS="function"
>checkdnsrr()</B
></A
></DT
><DT
><A
HREF="function.dns-get-mx.html"
>dns_get_mx</A
>&nbsp;--&nbsp;Synonym for <A
HREF="function.getmxrr.html"
><B
CLASS="function"
>getmxrr()</B
></A
></DT
><DT
><A
HREF="function.dns-get-record.html"
>dns_get_record</A
>&nbsp;--&nbsp;
      Fetch DNS Resource Records associated with a hostname
     </DT
><DT
><A
HREF="function.fsockopen.html"
>fsockopen</A
>&nbsp;--&nbsp;
     Open Internet or Unix domain socket connection
    </DT
><DT
><A
HREF="function.gethostbyaddr.html"
>gethostbyaddr</A
>&nbsp;--&nbsp;
     Get the Internet host name corresponding to a given IP address
    </DT
><DT
><A
HREF="function.gethostbyname.html"
>gethostbyname</A
>&nbsp;--&nbsp;
     Get the IP address corresponding to a given Internet host name
    </DT
><DT
><A
HREF="function.gethostbynamel.html"
>gethostbynamel</A
>&nbsp;--&nbsp;
     Get a list of IP addresses corresponding to a given Internet host
     name
    </DT
><DT
><A
HREF="function.getmxrr.html"
>getmxrr</A
>&nbsp;--&nbsp;
     Get MX records corresponding to a given Internet host name
    </DT
><DT
><A
HREF="function.getprotobyname.html"
>getprotobyname</A
>&nbsp;--&nbsp;
     Get protocol number associated with protocol name
    </DT
><DT
><A
HREF="function.getprotobynumber.html"
>getprotobynumber</A
>&nbsp;--&nbsp;
     Get protocol name associated with protocol number
    </DT
><DT
><A
HREF="function.getservbyname.html"
>getservbyname</A
>&nbsp;--&nbsp;
     Get port number associated with an Internet service and protocol
    </DT
><DT
><A
HREF="function.getservbyport.html"
>getservbyport</A
>&nbsp;--&nbsp;
     Get Internet service which corresponds to port and protocol
    </DT
><DT
><A
HREF="function.header.html"
>header</A
>&nbsp;--&nbsp;Send a raw HTTP header</DT
><DT
><A
HREF="function.headers-list.html"
>headers_list</A
>&nbsp;--&nbsp;Returns a list of response headers sent (or ready to send)</DT
><DT
><A
HREF="function.headers-sent.html"
>headers_sent</A
>&nbsp;--&nbsp;Checks if or where headers have been sent</DT
><DT
><A
HREF="function.inet-ntop.html"
>inet_ntop</A
>&nbsp;--&nbsp;
      Converts a packed internet address to a human readable representation
    </DT
><DT
><A
HREF="function.inet-pton.html"
>inet_pton</A
>&nbsp;--&nbsp;
      Converts a human readable IP address to its packed in_addr representation
    </DT
><DT
><A
HREF="function.ip2long.html"
>ip2long</A
>&nbsp;--&nbsp;
      Converts a string containing an (IPv4) Internet Protocol dotted address
      into a proper address
    </DT
><DT
><A
HREF="function.long2ip.html"
>long2ip</A
>&nbsp;--&nbsp;
      Converts an (IPv4) Internet network address into a string in Internet
      standard dotted format 
    </DT
><DT
><A
HREF="function.openlog.html"
>openlog</A
>&nbsp;--&nbsp;Open connection to system logger</DT
><DT
><A
HREF="function.pfsockopen.html"
>pfsockopen</A
>&nbsp;--&nbsp;
     Open persistent Internet or Unix domain socket connection
    </DT
><DT
><A
HREF="function.setcookie.html"
>setcookie</A
>&nbsp;--&nbsp;Send a cookie</DT
><DT
><A
HREF="function.setrawcookie.html"
>setrawcookie</A
>&nbsp;--&nbsp;Send a cookie without urlencoding the cookie value</DT
><DT
><A
HREF="function.socket-get-status.html"
>socket_get_status</A
>&nbsp;--&nbsp;别名 <A
HREF="function.stream-get-meta-data.html"
><B
CLASS="function"
>stream_get_meta_data()</B
></A
></DT
><DT
><A
HREF="function.socket-set-blocking.html"
>socket_set_blocking</A
>&nbsp;--&nbsp;别名 <A
HREF="function.stream-set-blocking.html"
><B
CLASS="function"
>stream_set_blocking()</B
></A
></DT
><DT
><A
HREF="function.socket-set-timeout.html"
>socket_set_timeout</A
>&nbsp;--&nbsp;别名 <A
HREF="function.stream-set-timeout.html"
><B
CLASS="function"
>stream_set_timeout()</B
></A
></DT
><DT
><A
HREF="function.syslog.html"
>syslog</A
>&nbsp;--&nbsp;Generate a system log message</DT
></DL
></DIV
></DIV
></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.ncurses-wvline.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.checkdnsrr.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>ncurses_wvline</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="funcref.html"
ACCESSKEY="U"
>上一级</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>checkdnsrr</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>