1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 297078 $ -->
<sect1 xml:id="internals2.buildsys.environment" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Building PHP for extension development</title>
<para>
In a typical PHP installation, the need for high performance almost always
results in optimization at the cost of debugging facilities. This is a
reasonable tradeoff for production use, but when developing an extension it
falls short. What we need is a build of PHP which will give us some hints
what has gone wrong when something does.
</para>
<para>
The Zend Engine provides a memory manager which is capable of tracking
memory leaks in extensions and providing detailed debugging information.
This tracking is disabled by default, as is thread-safety. To turn them
on, pass the <option role="configure">--enable-debug</option> and
<literal>--enable-maintainer-zts</literal> options to
<filename>configure</filename>, along with whatever options you typically
use. For instructions on building PHP from source, see the instructions at
<xref linkend="install.general"/>. A typical <filename>configure</filename>
line might look like this:
<programlisting role="shell">
<![CDATA[
$ ./configure --prefix=/where/to/install/php --enable-debug --enable-maintainer-zts --enable-cgi --enable-cli --with-mysql=/path/to/mysql
]]>
</programlisting>
</para>
</sect1>
<!-- Write this later?
<sect1 xml:id="internals2.buildsys.environment.parallel">
<title>Running debug and production PHP builds in parallel</title>
</sect1>
-->
<!-- 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
-->
|