Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > main > by-pkgid > 0afeee9cca140e167a996902b9a677c5 > files > 450

php-manual-en-4.3.0-2mdk.noarch.rpm

<HTML
><HEAD
><TITLE
>dl</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="PHP Manual"
HREF="index.html"><LINK
REL="UP"
TITLE="PHP Options&Information"
HREF="ref.info.html"><LINK
REL="PREVIOUS"
TITLE="assert"
HREF="function.assert.html"><LINK
REL="NEXT"
TITLE="extension_loaded"
HREF="function.extension-loaded.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-1"></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 Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.assert.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.extension-loaded.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.dl"
></A
>dl</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN73474"
></A
><P
>    (PHP 3, PHP 4 )</P
>dl&nbsp;--&nbsp;Loads a PHP extension at runtime</DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN73477"
></A
><H2
>Description</H2
>bool <B
CLASS="methodname"
>dl</B
> ( string library)<BR
></BR
><P
>&#13;     Loads the PHP extension given by the parameter
     <TT
CLASS="parameter"
><I
>library</I
></TT
>. The <TT
CLASS="parameter"
><I
>library</I
></TT
>
     parameter is <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>only</I
></SPAN
> the filename of the extension to
     load which also depends on your platform. For example, the <A
HREF="ref.sockets.html"
>sockets</A
> extension (if compiled as a shared
     module, not the default!) would be called <TT
CLASS="filename"
>sockets.so</TT
>
     on unix platforms whereas it is called
     <TT
CLASS="filename"
>php_sockets.dll</TT
> on the windows platform.
    </P
><P
>&#13;     Returns <TT
CLASS="constant"
><B
>TRUE</B
></TT
> on success or <TT
CLASS="constant"
><B
>FALSE</B
></TT
> on failure. If the functionality of loading modules is not available
     (see Note) or has been disabled (either by turning it off
     <TT
CLASS="literal"
>enable_dl</TT
> or by enabling <TT
CLASS="literal"
>safe_mode</TT
>
     in <TT
CLASS="filename"
>php.ini</TT
>) an <TT
CLASS="constant"
><B
>E_ERROR</B
></TT
> is emitted
     and execution is stopped. If <B
CLASS="function"
>dl()</B
> fails because the
     specified library couldn't be loaded, in addition to <TT
CLASS="constant"
><B
>FALSE</B
></TT
> an
     <TT
CLASS="constant"
><B
>E_WARNING</B
></TT
> message is emitted.
    </P
><P
>&#13;     Use <A
HREF="function.extension-loaded.html"
><B
CLASS="function"
>extension_loaded()</B
></A
> to test whether a given
     extension is already available or not. This works on both built-in
     extensions and dynamically loaded ones (either through <TT
CLASS="filename"
>php.ini</TT
>
     or <B
CLASS="function"
>dl()</B
>).
    </P
><P
>&#13;     Example:
     <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="php"
>if (!extension_loaded('gd')) {
    if (!dl('gd.so')) {
        exit;
    }
}</PRE
></TD
></TR
></TABLE
>
    </P
><P
>&#13;     The directory where the extension is loaded from depends on your
     platform:
    </P
><P
>&#13;     Windows - If not explicitly set in the <TT
CLASS="filename"
>php.ini</TT
>, the extension is
     loaded from <TT
CLASS="filename"
>c:\php4\extensions\</TT
> by default.
    </P
><P
>&#13;     Unix - If not explicitly set in the <TT
CLASS="filename"
>php.ini</TT
>, the default extension
     directory depends on
     <P
></P
><UL
><LI
><P
>&#13;        whether PHP has been built with <TT
CLASS="literal"
>--enable-debug</TT
> or
        not
       </P
></LI
><LI
><P
>&#13;        whether PHP has been built with (experimental) ZTS (Zend Thread Safety)
        support or not
       </P
></LI
><LI
><P
>&#13;        the current internal <TT
CLASS="literal"
>ZEND_MODULE_API_NO</TT
> (Zend
        internal module API number, which is basically the date on which a
        major module API change happened, e.g. <TT
CLASS="literal"
>20010901</TT
>)
       </P
></LI
></UL
>
     Taking into account the above, the directory then defaults to
     <TT
CLASS="literal"
>&#60;php-install-directory&#62;/lib/php/extension/&#60;debug-or-not&#62;-&#60;zts-or-not&#62;-ZEND_MODULE_API_NO</TT
>,
     e.g.
     <TT
CLASS="filename"
>/usr/local/php/lib/php/extensions/debug-non-zts-20010901</TT
>
     or
     <TT
CLASS="filename"
>/usr/local/php/lib/php/extensions/no-debug-zts-20010901</TT
>.
    </P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
      <B
CLASS="function"
>dl()</B
> is <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>not</I
></SPAN
> supported in
      multithreaded Web servers. Use the <TT
CLASS="literal"
>extensions</TT
>
      statement in your <TT
CLASS="filename"
>php.ini</TT
> when operating under such
      an environment. However, the <TT
CLASS="literal"
>CGI</TT
> and
      <TT
CLASS="literal"
>CLI</TT
> build are <SPAN
CLASS="strong"
><B
CLASS="emphasis"
>not</B
></SPAN
>
      affected !
     </P
></BLOCKQUOTE
></DIV
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
      <B
CLASS="function"
>dl()</B
> is case sensitive on unix platforms.
     </P
></BLOCKQUOTE
></DIV
><P
>&#13;     See also
     <A
HREF="configuration.directives.html#ini.extension"
>Extension Loading Directives</A
>
     and <A
HREF="function.extension-loaded.html"
><B
CLASS="function"
>extension_loaded()</B
></A
>.
    </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.assert.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.extension-loaded.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>assert</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.info.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>extension_loaded</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>