mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
153 lines
5.1 KiB
XML
153 lines
5.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 050e16021ff71318012fa16322e98d8603d5ab38 Maintainer: leonardolara Status: ready -->
|
|
<section xml:id="mysqli.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
|
|
&reftitle.install;
|
|
|
|
<para>
|
|
A extensão <literal>mysqli</literal> foi introduzida com o PHP versão
|
|
5.0.0. O MySQL Native Driver foi incluído no PHP na versão 5.3.0.
|
|
</para>
|
|
|
|
<section xml:id="mysqli.installation.linux">
|
|
|
|
<title>Instalação no Linux</title>
|
|
|
|
<para>
|
|
As distribuições comuns do Unix incluem versões binárias do PHP que podem
|
|
ser instaladas. Embora estas versões binárias sejam tipicamente construídas com
|
|
suporte às extensões MySQL, as próprias bibliotecas das extensões
|
|
podem precisar de pacote adicional para instalação. Verifique
|
|
o gerenciador de pacote que vem com sua distribuição escolhida para
|
|
disponibilidade.
|
|
</para>
|
|
|
|
<para>
|
|
Por exemplo, no Ubuntu o pacote <literal>php5-mysql</literal> instala
|
|
as extensões do PHP ext/mysql, ext/mysqli e pdo_mysql. No CentOS,
|
|
o pacote <literal>php-mysql</literal> também instala estas três
|
|
extensões PHP.
|
|
</para>
|
|
|
|
<para>
|
|
Alternativamente, pode-se compilar esta extensão. Construir o PHP a partir
|
|
do código-fonte permite que se especifique as extensões MySQL que se deseja usar,
|
|
bem como pode-se escolher a biblioteca cliente para cada extensão.
|
|
</para>
|
|
|
|
<para>
|
|
O MySQL Native Driver é a opção de biblioteca cliente recomendada, pois
|
|
resulta em melhor desempenho e dá acesso a recursos não disponíveis
|
|
ao usar a Biblioteca Cliente MySQL. Consulte a página
|
|
<link linkend="mysqli.overview.mysqlnd">O que é o Driver Nativo do MySQL?</link>
|
|
para uma visão breve das vantagens do Driver Nativo
|
|
MySQL.
|
|
</para>
|
|
|
|
<para>
|
|
<literal>/path/to/mysql_config</literal> representa a localização do
|
|
programa <literal>mysql_config</literal> que vem com o Servidor
|
|
MySQL.
|
|
</para>
|
|
|
|
<table xml:id="mysqli.installation.time.matrix">
|
|
<title>Matriz de suporte ao mysqli em tempo de compilação</title>
|
|
<tgroup cols="5">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version; do PHP</entry>
|
|
<entry>&Default;</entry>
|
|
<entry>&ConfigureOptions;: <link linkend="mysqlnd.overview">mysqlnd</link></entry>
|
|
<entry>&ConfigureOptions;: <literal>libmysqlclient</literal></entry>
|
|
<entry>&Changelog;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>5.4.x e acima</entry>
|
|
<entry>mysqlnd</entry>
|
|
<entry><option role="configure">--with-mysqli</option></entry>
|
|
<entry><option role="configure">--with-mysqli=/path/to/mysql_config</option></entry>
|
|
<entry>mysqlnd é o padrão</entry>
|
|
</row>
|
|
<row>
|
|
<entry>5.3.x</entry>
|
|
<entry>libmysqlclient</entry>
|
|
<entry><option role="configure">--with-mysqli=mysqlnd</option></entry>
|
|
<entry><option role="configure">--with-mysqli=/path/to/mysql_config</option></entry>
|
|
<entry>mysqlnd é suportada</entry>
|
|
</row>
|
|
<row>
|
|
<entry>5.0.x, 5.1.x, 5.2.x</entry>
|
|
<entry>libmysqlclient</entry>
|
|
<entry>&NotAvailable;</entry>
|
|
<entry><option role="configure">--with-mysqli=/path/to/mysql_config</option></entry>
|
|
<entry>mysqlnd não é suportada</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</table>
|
|
|
|
<para>
|
|
Observe que é possível misturar livremente extensões MySQL e bibliotecas
|
|
cliente. Por exemplo, é possível habilitar a extensão MySQL
|
|
para usar a biblioteca cliente MySQL (libmysqlclient), enquanto configura
|
|
a extensão <literal>mysqli</literal> para usar o driver nativo MySQL.
|
|
No entanto, todas as permutações de extensão e biblioteca cliente são
|
|
possíveis.
|
|
</para>
|
|
|
|
</section>
|
|
|
|
<section xml:id="mysqli.installation.windows">
|
|
|
|
<title>Instalação em Sistemas Windows</title>
|
|
|
|
<para>
|
|
No Windows, a DLL <filename>php_mysqli.dll</filename> deve ser habilitada no
|
|
&php.ini;.
|
|
</para>
|
|
|
|
<para>
|
|
Como em qualquer habilitação de extensão PHP (como
|
|
<filename>php_mysqli.dll</filename>), a diretiva PHP
|
|
<link linkend="ini.extension-dir">extension_dir</link> seve ser definida
|
|
para o diretório onde as extensões do PHP estão localizadas. Consulte também as
|
|
<link linkend="install.windows.manual">Instruções de Instalação Manual no Windows</link>.
|
|
Um exemplo de valor para <literal>extension_dir</literal>
|
|
é <filename>c:\php\ext</filename>.
|
|
</para>
|
|
|
|
<note>
|
|
<para>
|
|
Se ao iniciar o servidor web um erro parecido com este ocorrer:
|
|
<literal>"Unable to load dynamic library './php_mysqli.dll'"</literal>,
|
|
é porque
|
|
<filename>php_mysqli.dll</filename> não pôde ser encontrada no sistema.
|
|
</para>
|
|
</note>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|