dismiss Step into the future! Click here to switch to the beta php.net site
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Problemas?> <Compilando extensões compartilhadas PECL com phpize
[edit] Last updated: Fri, 28 Jun 2013

view this page in

Compilando extensões PECL estaticamente no PHP

Você pode decidir que precisa montar uma extensão PECL estaticamente no seu binário do PHP. Para isso, você precisará colocar os fontes da extensão no diretório php-src/ext/ e dizer para o sistema de montagem do PHP para regenerar o script configure.

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

Isso resultará no seguinte diretório:


/your/phpsrcdir/ext/extname

Daqui, faça o PHP reconstruir o script configure e monte o PHP normalmente:


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

Nota: Para executar o script 'buildconf' você precisa de autoconf 2.13 e automake 1.4+ (versões mais novas do autoconf podem funcionar, mas não são suportadas).

Se --enable-extname ou --with-extname são usadas depende da extensão. Tipicamente, uma extensão que não requer bibliotecas externa usa --enable. Para ter certeza, rode o seguinte comando após buildconf:


$ ./configure --help | grep extname



add a note add a note User Contributed Notes Compilando extensões PECL estaticamente no PHP - [2 notes]
up
1
anthon at piwik dot org
10 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