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

search for in the

¿Problemas?> <php-config
[edit] Last updated: Fri, 24 May 2013

view this page in

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 php-src/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 add a note User Contributed Notes Compilando extensiones PECL estáticamente en PHP - [2 notes]
up
1
anthon at piwik dot org
9 months ago
Some extensions cannot be statically linked (e.g., xdebug).
up
-1
denis_truffaut a t hotmail d o t com
1 year ago
A tip that could save your time : Don't forget to erase the cache beforce forcing buildconf...

sudo rm -f configure autom4te.cache
sudo ./buildconf --force

 
show source | credits | stats | sitemap | contact | advertising | mirror sites