<!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>Building PHP for extension development</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="internals2.buildsys.html">The PHP 5 build system</a></div> <div class="next" style="text-align: right; float: right;"><a href="internals2.buildsys.skeleton.html">The ext_skel script</a></div> <div class="up"><a href="internals2.buildsys.html">The PHP 5 build system</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="internals2.buildsys.environment" class="sect1"> <h2 class="title">Building PHP for extension development</h2> <p class="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. </p> <p class="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 <strong class="option configure">--enable-debug</strong> and <em>--enable-maintainer-zts</em> options to <var class="filename">configure</var>, along with whatever options you typically use. For instructions on building PHP from source, see the instructions at <a href="install.general.html" class="xref">General Installation Considerations</a>. A typical <var class="filename">configure</var> line might look like this: <div class="example-contents"> <div class="shellcode"><pre class="shellcode">$ ./configure --prefix=/where/to/install/php --enable-debug --enable-maintainer-zts --enable-cgi --enable-cli --with-mysql=/path/to/mysql</pre> </div> </div> </p> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="internals2.buildsys.html">The PHP 5 build system</a></div> <div class="next" style="text-align: right; float: right;"><a href="internals2.buildsys.skeleton.html">The ext_skel script</a></div> <div class="up"><a href="internals2.buildsys.html">The PHP 5 build system</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>