Source of: /manual/en/pdo.installation.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/pdo.setup.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'pdo.installation.php',
1 => 'Installation',
),
'up' =>
array (
0 => 'pdo.setup.php',
1 => 'Installing/Configuring',
),
'prev' =>
array (
0 => 'pdo.requirements.php',
1 => 'Requirements',
),
'next' =>
array (
0 => 'pdo.configuration.php',
1 => 'Runtime Configuration',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="pdo.installation" class="section">
<h2 class="title">Installation</h2>
<div class="procedure">
<b class="title">Installing PDO on Unix systems</b>
<ol type="1"><li>
<p class="para">
PDO and the <a href="ref.pdo-sqlite.php" class="link">PDO_SQLITE</a> driver
is enabled by default as of PHP 5.1.0. You may need
to enable the PDO driver for your database of choice; consult the
documentation for
<a href="pdo.drivers.php" class="link">database-specific PDO drivers</a>
to find out more about that.
Note: When building PDO as a shared extension (<em class="emphasis">not
recommended</em>) then all PDO drivers <em class="emphasis">must</em>
be loaded <em class="emphasis">after</em> PDO itself.
</p>
</li>
<li>
<p class="para">
When installing PDO as a shared module, the php.ini file needs to be
updated so that the PDO extension will be loaded automatically when PHP runs.
You will also need to enable any database specific drivers there too;
make sure that they are listed after the pdo.so line, as PDO must be
initialized before the database-specific extensions can be loaded.
If you built PDO and the database-specific extensions statically, you
can skip this step.
<div class="example-contents screen">
<div class="cdata"><pre>
extension=pdo.so
</pre></div>
</div>
</p>
</li>
</ol></div>
<div class="procedure">
<b class="title">Windows users</b>
<ol type="1"><li>
<p class="para">
PDO and all the major drivers ship with PHP as shared extensions, and
simply need to be activated by editing the <var class="filename">php.ini</var> file:
<div class="example-contents screen">
<div class="cdata"><pre>
extension=php_pdo.dll
</pre></div>
</div>
</p>
</li>
<li>
<p class="para">
Next, choose the other database-specific DLL files and either use
<a href="function.dl.php" class="function">dl()</a> to load them at runtime, or enable them in
<var class="filename">php.ini</var> below <var class="filename">php_pdo.dll</var>. For example:
<div class="example-contents screen">
<div class="cdata"><pre>
extension=php_pdo.dll
extension=php_pdo_firebird.dll
extension=php_pdo_informix.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
</pre></div>
</div>
</p>
<p class="para">
These DLLs should exist in the system's
<a href="ini.core.php#ini.extension-dir" class="link">extension_dir</a>.
</p>
</li>
</ol></div>
</div><?php manual_footer(); ?>