Skip to content

Latest commit

 

History

History
78 lines (50 loc) · 1.7 KB

00-primer-compiling-php.md

File metadata and controls

78 lines (50 loc) · 1.7 KB

Configure

$ ./configure

PHP extensions can be bundled into the core executable (prevents wrong execution order, failed dependencies etc.) or compiled as shared objects to be included at runtime through php.ini.

Enabling and Disabling Extensions

Defaults are determined by the config.[m4|w32] files that can be found in ext/ directories.

--enable-foo [typically disabled by default]

--disable-foo [typically enabled by default]

--with-foo [requires external lib, typically disabled by default]

--without-foo [requires external lib, typically enabled by default]

Extensions As Shared Objects

Some support the shared option

--enable-foo=shared

--with-foo=shared,/path/to/lib

Build Directories and Configure

$ cd ~/php-src && mkdir custom-build && cd custom-build && ~/php-src/configure --my-flags

Compiling

Overview

$ ./buildconfig
$ ./configure --flags
$ make

Flags Of Interest

Debug

Reports memory leaks via detection of lost memory blocks that are cleaned up post execution. Also includes the debugging symbols for GDB.

--enable-debug

GCOV

Requires lcov and genhtml available on the path and gcov installed. See lcov state files. Enables code coverage analysis and report generation.

--enable-gcov

ZTS Maintainer

Enables the zend thread safety layer, slower but useful for debugging.

--enable-maintainer-zts

Thanks to @derickr and @johannes for their patience and tutelage!