php-doc-en/reference/sqlite/setup.xml

130 lines
3.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<chapter xml:id="sqlite.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.setup;
<!-- {{{ Requirements -->
<section xml:id="sqlite.requirements">
&reftitle.required;
<para>
The SQLite extension is enabled by default as of PHP 5.0. Beginning with
PHP 5.4, the SQLite extension is available only via PECL.
</para>
</section>
<!-- }}} -->
<!-- {{{ Installation -->
<section xml:id="sqlite.installation">
&reftitle.install;
<para>
Since PHP 5.0 this extension was bundled with PHP. Beginning with PHP 5.4,
this extension is available only via PECL.
</para>
<para>
Windows users must enable <filename>php_sqlite.dll</filename> inside
of &php.ini; in order to use these functions.
&pecl.windows.download;
</para>
<para>
Windows builds must also enable PDO because as of PHP 5.1.0 it depends
on it. So, &php.ini; will end up with something like this:
<informalexample>
<programlisting role="ini">
<![CDATA[
extension=php_pdo.dll
extension=php_sqlite.dll
]]>
</programlisting>
</informalexample>
On Linux or Unix operating systems, if you build PDO as a shared
extension, you must build SQLite as a shared extension using the
<command>--with-sqlite=shared</command> configure option.
</para>
<para>
The PHP 5.0.x series of Windows builds enabled this extension by
default, where no <acronym>DLL</acronym> file is necessary.
</para>
<para>
SQLite 3 is supported through <link
linkend="ref.pdo-sqlite">PDO SQLite</link>.
</para>
<note>
<title>Windows installation for unprivileged accounts</title>
<para>
On Windows operating systems, unprivileged accounts don't have the
<varname>TMP</varname> environment variable set by default. This will
make sqlite create temporary files in the windows directory, which is
not desirable. So, you should set the <varname>TMP</varname> environment
variable for the web server or the user account the web server is
running under. If Apache is your web server, you can accomplish this via
a <command>SetEnv</command> directive in your &httpd.conf; file. For
example:
<informalexample>
<programlisting role="apache-conf">
<![CDATA[
SetEnv TMP c:/temp
]]>
</programlisting>
</informalexample>
If you are unable to establish this setting at the server
level, you can implement the setting in your script:
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
putenv('TMP=C:/temp');
?>
]]>
</programlisting>
</informalexample>
The setting must refer to a directory that the web server
has permission to create files in and subsequently write
to and delete the files it created.
Otherwise, you may receive the following error message:
<computeroutput>
malformed database schema -
unable to open a temporary database file for storing temporary tables
</computeroutput>
</para>
</note>
</section>
<!-- }}} -->
<!-- {{{ Configuration -->
&reference.sqlite.ini;
<!-- }}} -->
<!-- {{{ Resources -->
<section xml:id="sqlite.resources">
&reftitle.resources;
<para>
There are two resources used in the SQLite Interface. The first one is the
database connection, the second one the result set.
</para>
</section>
<!-- }}} -->
</chapter>
<!-- 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
-->