downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

The ext_skel script> <The PHP 5 build system
[edit] Last updated: Fri, 26 Apr 2013

view this page in

Building PHP for extension development

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.

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 --enable-debug and --enable-maintainer-zts options to configure, along with whatever options you typically use. For instructions on building PHP from source, see the instructions at General Installation Considerations. A typical configure line might look like this:

$ ./configure --prefix=/where/to/install/php --enable-debug --enable-maintainer-zts --enable-cgi --enable-cli --with-mysql=/path/to/mysql



add a note add a note User Contributed Notes Building PHP for extension development - [1 notes]
up
-1
rich dot d dot rich at gmail dot com
2 years ago
This may be obvious, but if you are installing PHP under a home directory, don't enter '--prefix=~/place'. Use the full form '--prefix=/home/fred/place'.

Otherwise, it will half work and cause problems (because the shell char gets expanded in some places and not others).

 
show source | credits | stats | sitemap | contact | advertising | mirror sites