array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'it', ), 'this' => array ( 0 => 'install.pecl.phpize.php', 1 => 'Compiling shared PECL extensions with phpize', ), 'up' => array ( 0 => 'install.pecl.php', 1 => 'Installation of PECL extensions', ), 'prev' => array ( 0 => 'install.pecl.pear.php', 1 => 'Compiling shared PECL extensions with the pecl command', ), 'next' => array ( 0 => 'install.pecl.php-config.php', 1 => 'php-config', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'install/pecl.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Compiling shared PECL extensions with phpize

Sometimes, using the pecl installer is not an option. This could be because there is a firewall or because the extension being installed is unavailable as a PECL-compatible package, such as unreleased extensions from git. If such an extension needs to be built, the lower-level build tools can be used to perform the build manually.

The phpize command is used to prepare the build environment for a PHP extension. In the following sample, the sources for an extension are in a directory named extname:

$ cd extname
$ phpize
$ ./configure
$ make
# make install

A successful install will have created extname.so and put it into the PHP extensions directory. The php.ini will need to be adjusted, and an extension=extname.so line will need to be added before the extension can be used.

If the system is missing the phpize command, and precompiled packages (like RPM's) are used, be sure to install also the appropriate development version of the PHP package as they often include the phpize command along with the proper header files to build PHP and its extensions.

Execute phpize --help to display additional usage information.