PHP 8.3.4 Released!

Compilando extensiones PECL estáticamente en PHP

Quizá necesite construir una extensión PECL estáticamente en su binario de PHP. Para hacer esto, necesitará ubicar el fuente de la extensión bajo el directorio /su/directorio_fuentes_php/ext/ e indicarle al sistema de construcción de PHP que regenere su script de configuración.

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

Esto generará el siguiente directorio:


/your/phpsrcdir/ext/extname

Desde aquí, fuerce a PHP a regenerar el script de configuración, y entonces construya PHP con normalidad:


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

Nota: Necesitará autoconf 2.13 y automake 1.4+ para ejecutar el script 'buildconf' (es posible que funcionen versiones más recientes de autoconf, pero no están oficialmente soportadas).

Dependiendo de la extensión, utilizará --enable-extname o --with-extname. Las extensiones que no requieren de bibliotecas externas generalmente utilizan --enable. Para asegurarse, ejecute el siguiente comando después de buildconf:


$ ./configure --help | grep extname

add a note

User Contributed Notes 1 note

up
6
anthon at piwik dot org
11 years ago
Some extensions cannot be statically linked (e.g., xdebug).
To Top