<!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>Installation</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="pdo.requirements.html">Requirements</a></div> <div class="next" style="text-align: right; float: right;"><a href="pdo.configuration.html">Runtime Configuration</a></div> <div class="up"><a href="pdo.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="pdo.installation" class="section"> <h2 class="title">Installation</h2> <div class="procedure"> <strong class="title">Installing PDO on Unix systems</strong> <ol type="1"><li> <p class="para"> PDO and the <a href="ref.pdo-sqlite.html" 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.html" class="link">database-specific PDO drivers</a> to find out more about that. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> 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> </p></blockquote> </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"> <strong class="title">Windows users</strong> <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> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> This step is not necessary for PHP 5.3 and above, as a DLL is no longer required for PDO. </p> </p></blockquote> </li> <li> <p class="para"> Next, choose the other database-specific DLL files and either use <span class="function"><a href="function.dl.html" class="function">dl()</a></span> 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.html#ini.extension-dir" class="link">extension_dir</a>. </p> </li> </ol></div> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> Remember that after making changes to your <var class="filename">php.ini</var> file you will need to restart PHP for your new configuration directives to take effect. </p> </p></blockquote> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="pdo.requirements.html">Requirements</a></div> <div class="next" style="text-align: right; float: right;"><a href="pdo.configuration.html">Runtime Configuration</a></div> <div class="up"><a href="pdo.setup.html">Installing/Configuring</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>