philip          Mon Aug 23 19:00:14 2004 EDT

  Added files:                 
    /phpdoc/RFC install_PECL.txt 
  Log:
  Initial checkin for the "PECL Install" section.  Please review and comment.
  
  

http://cvs.php.net/co.php/phpdoc/RFC/install_PECL.txt?r=1.1&p=1
Index: phpdoc/RFC/install_PECL.txt
+++ phpdoc/RFC/install_PECL.txt
RFC: Installing PECL Extensions

  Notes: - Have a separate section on where to get the source?
         - What's the deal with package.xml outside of the source dir?
         - wget pecl.php.net/get/extname retrieves a file named
           extname instead of extname.tgz, this needs fixing

-----------------------
General Considerations:
-----------------------
PHP extensions may be installed in a variety of ways.  PECL is a
repository of PHP extensions living within the PEAR structure, 
and the following demonstrates how to install these extensions.

The source of these extensions may be found at pecl.php.net or
to retrieve from CVS use:

  $ cvs -d:pserver:[EMAIL PROTECTED]:/repository login
  $ cvs -d:pserver:[EMAIL PROTECTED]:/repository co pecl/extname

Where extname is the name of the extension, and the password for
the cvsread user is phpfi.

When building PHP modules it's important to have the appropriate 
versions of the required tools (autoconf,automake,libtool,etc.)
See http://www.php.net/anoncvs.php for details.

Windows users will find compiled PECL extension binaries here:
  
  * http://www.php.net/downloads.php
  * http://snaps.php.net/

Further information for the extension can be found here:

  * http://pecl.php.net/extname

Assumptions:
  
  a) extname is the name of the extension
  b) /your/phpsrcdir/ is the path to your PHP source


-----------------------
PEAR Shared:
-----------------------
PEAR makes it easy to create shared (.so) PHP extensions.  Using the pear
command do the following:

  $ pear install extname

That will download the source for extname, and compile it on the system.
This results in a .so file that may then be included in php.ini

In case the preferred_state differs, like it's set to stable and
the extension is still in beta, either set the preferred_state
via "pear config-set" or simply specify a specific version of
the extension.  For example:

  $ pear install extname-0.1.1
  
Either way pear will copy this .so into your extensions directory.
Modify php.ini accordingly.

-----------------------
Manual Shared:
-----------------------
If using pear is not an option then creating a shared extension may
also be done as follows.  The pear command essentially does this but
it may also be done manually.  Let's call the source file extname.tgz
and assume it was downloaded into the current directory:

  $ gzip -d < extname.tgz |tar -xvf -
  $ cd extname
  $ phpize
  $ ./configure && make

This creates a .so file (extname.so) and puts it in a modules/ and/or..libs/ directory 
within extname/.  Move this into the PHP extensions
directory, and then include it inside of php.ini

-----------------------
PHP Static:
-----------------------
To statically include the extension within the PHP build, put the
extensions source within the ext/ directory found in the PHP source.
For example:

  $ cd /your/phpsrcdir/ext
  $ gzip -d < extname.tgz |tar -xvf -
  $ mv extname-x.x.x extname
  $ mv package.xml extname

This will result in the following directory:

  /your/phpsrcdir/ext/extname

>From here, build your PHP as normal:

  $ cd /your/phpsrcdir
  $ ./buildconf
  $ ./configure --help
  $ ./configure --with=extname --enable=someotherext --with=foobar
  $ make
  $ make install

Whether --enable or --with is used depends on the extension.  Typically an
extension that does not require external libraries uses --enable.  To be
sure, after running buildconf try:

  $ ./configure --help |grep extname

Reply via email to