Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 8214

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Installing a PHP extension on Windows</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="install.pecl.downloads.html">Downloading PECL extensions</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="install.pecl.pear.html">Compiling shared PECL extensions with the pecl command</a></div>
 <div class="up"><a href="install.pecl.html">Installation of PECL extensions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="install.pecl.windows" class="sect1">
  <h2 class="title">Installing a PHP extension on Windows</h2>
  <p class="para">
   On Windows, you have two ways to load a PHP extension: either compile it into PHP, or 
   load the DLL. Loading a pre-compiled extension is the easiest and preferred way.
  </p>
  <p class="para">
   To load an extension, you need to have it available as a &quot;.dll&quot; file on your system. 
   All the extensions are automatically and periodically compiled by the PHP Group 
   (see next section for the download).
  </p>
  <p class="para">
   To compile an extension into PHP, please refer to <a href="install.windows.building.html" class="link">
   building from source</a> documentation.
  </p>
  <p class="para">
   To compile a standalone extension (aka a DLL file), please refer to <a href="install.windows.building.html" class="link">
   building from source</a> documentation. If the DLL file is available neither with your 
   PHP distribution nor in PECL, you may have to compile it before you can start using the 
   extension.
  </p>

  <div class="sect2" id="install.pecl.windows.find">
   <h3 class="title">Where to find an extension?</h3>
   <p class="para">
    PHP extensions are usually called &quot;php_*.dll&quot; (where the star represents the name of 
    the extension) and   they are located under the &quot;PHP\ext&quot; (&quot;PHP\extensions&quot; in PHP 4) 
    folder.
   </p>
   <p class="para">
    PHP ships with the extensions most useful to the majority of developers. They are 
    called &quot;core&quot; extensions.
   </p>
   <p class="para">
    However, if you need functionality not provided by any core extension, you may still be 
    able to find one in PECL. The PHP Extension Community Library (PECL) is a repository for 
    PHP Extensions, providing a directory of all known extensions and hosting facilities for 
    downloading and development of PHP extensions.
   </p>
   <p class="para">
    If you have developed an extension for your own uses, you might want to think about hosting 
    it on PECL so that others with the same needs can benefit from your time. A nice side effect 
    is that you give them a good chance to give you feedback, (hopefully) thanks, bug reports 
    and even fixes/patches. Before you submit your extension for hosting on PECL, please read 
    http://pecl.php.net/package-new.php.
   </p>
  </div>

  <div class="sect2" id="install.pecl.windows.which">
   <h3 class="title">Which extension to download?</h3>
   <p class="para">
    <em class="emphasis">Many times, you will find several versions of each DLL:</em>
    <ul class="itemizedlist">
     <li class="listitem">
      <span class="simpara">
       Different version numbers (at least the first two numbers should match)
      </span>
     </li>
     <li class="listitem">
      <span class="simpara">
       Different thread safety settings
      </span>
     </li>
     <li class="listitem">
      <span class="simpara">
       Different processor architecture (x86, x64, ...)
      </span>
     </li>
     <li class="listitem">
      <span class="simpara">
       Different debugging settings
      </span>
     </li>
     <li class="listitem">
      <span class="simpara">
       <em>etc.</em>
      </span>
     </li>
    </ul>
   </p>
   <p class="para">
    You should keep in mind that your extension settings should match all the 
    settings of the PHP executable you are using. The following PHP script will 
    tell you <em class="emphasis">all</em> about your PHP settings:
   </p>
   <p class="para">
    <div class="example" id="example-62">
     <p><strong>Example #1  <span class="function"><a href="function.phpinfo.html" class="function">phpinfo()</a></span> call</strong></p>
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />phpinfo</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
     </div>

    </div>
   </p>
   <p class="para">
    Or from the command line, run:
    <div class="example-contents screen">
<div class="cdata"><pre>
drive:\\path\to\php\executable\php.exe -i
</pre></div>
    </div>
   </p>
  </div>

  <div class="sect2" id="install.pecl.windows.loading">
   <h3 class="title">Loading an extension</h3>
   <p class="para">
    The most common way to load a PHP extension is to include it in your <var class="filename">php.ini</var> 
    configuration file. Please note that many extensions are already present in your 
    <var class="filename">php.ini</var> and that you only need to remove the semicolon to activate them.
    <div class="example-contents screen">
<div class="cdata"><pre>
;extension=php_extname.dll
</pre></div>
    </div>
    <div class="example-contents screen">
<div class="cdata"><pre>
extension=php_extname.dll
</pre></div>
    </div>
   </p>
   <p class="para">
    However, some web servers are confusing because they do not use the <var class="filename">php.ini</var> located alongside 
    your PHP executable. To find out where your actual <var class="filename">php.ini</var> resides, look 
    for its path in  <span class="function"><a href="function.phpinfo.html" class="function">phpinfo()</a></span>:
    <div class="example-contents screen">
<div class="cdata"><pre>
Configuration File (php.ini) Path  C:\WINDOWS
</pre></div>
    </div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Loaded Configuration File   C:\Program Files\PHP\5.2\php.ini
</pre></div>
    </div>
   </p>
   <p class="para">
    After activating an extension, save <var class="filename">php.ini</var>, restart the web server and check 
     <span class="function"><a href="function.phpinfo.html" class="function">phpinfo()</a></span> again. The new extension should now have its own section.
   </p>
  </div>

  <div class="sect2" id="install.pecl.windows.problemsolving">
   <h3 class="title">Resolving problems</h3>
   <p class="para">
    If the extension does not appear in  <span class="function"><a href="function.phpinfo.html" class="function">phpinfo()</a></span>, you should check your logs to 
    learn where the problem comes from.
   </p>
   <p class="para">
    If you are using PHP from the command line (CLI), the extension loading error can be read 
    directly on screen.
   </p>
   <p class="para">
    If you are using PHP with a web server, the location and format of the logs vary depending on 
    your software. Please read your web server documentation to locate the logs, as it does not 
    have anything to do with PHP itself.
   </p>
   <p class="para">
    Common problems are the location of the DLL, the value of the &quot;<a href="ini.core.html#ini.extension-dir" class="link">
    extension_dir</a>&quot; setting inside <var class="filename">php.ini</var> and compile-time setting mismatches.
   </p>
   <p class="para">
    If the problem lies in a compile-time setting mismatch, you probably didn&#039;t download the right DLL. 
    Try downloading again the extension with the right settings. Again,  <span class="function"><a href="function.phpinfo.html" class="function">phpinfo()</a></span> 
    can be of great help.
   </p>
  </div>

 </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="install.pecl.downloads.html">Downloading PECL extensions</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="install.pecl.pear.html">Compiling shared PECL extensions with the pecl command</a></div>
 <div class="up"><a href="install.pecl.html">Installation of PECL extensions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>