PHP: Compiling shared PECL extensions with phpize - Manual

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

search for in the

Compiling PECL extensions statically into PHP Compiling shared PECL extensions with PEAR

Last updated: Fri, 26 Jan 2007

view this page in

# Compiling shared PECL extensions with phpize

Sometimes, using the `pear` installer is not an option. This could be because you're behind a firewall, or it could be because the extension you want to install is not available as a PEAR compatible package, such as unreleased extensions from CVS. If you need to build such an extension, you can use the lower-level build tools 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. You'll need to and adjust `php.ini` and add an `extension=extname.so` line before you can use the extension.

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

Execute `phpize --help` to display additional usage information.

add a note User Contributed Notes
Compiling shared PECL extensions with phpize
dmytton at php dot net
03-Dec-2005 11:45
`In some situations (e.g. on a cPanel server), the built extension will not be placed into the correct extensions directory by the make install process. Use your phpinfo() output to determine what the correct extension_dir path is and move the generated .so file into that directory. The extension=extname.so line in php.ini will then find the extension file correctly.`
add a note
Compiling PECL extensions statically into PHP Compiling shared PECL extensions with PEAR

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST