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

search for in the

PECL eklentilerinin PHP içinde duruk olarak derlenmesi> <Paylaşımlı PECL eklentilerinin pecl komutu ile derlenmesi
[edit] Last updated: Fri, 23 Mar 2012

view this page in

Paylaşımlı PECL eklentilerinin phpize ile derlenmesi

pecl komutu ile kurulumun mümkün olmadığı durumlar olabilir. Bir güvenlik duvarı arkasındasınızdır veya eklentinin PECL uyumlu paketi yoktur ya da henüz dağıtılmamış SVN sürümünü kurmak istiyorsunuzdur, vs. Böyle bir eklentinin derleme işlemini daha alt seviye derleme araçlarını kullanarak kendiniz gerçekleştirebilirsiniz.

Bir PHP eklentisini derleme işlemine hazırlamak için phpize komutu kullanılır. Aşağıdaki örnekte, eklentinin kaynak kod paketinin eklenti dizininde bulunduğu varsayılmıştır:

$ cd eklenti
$ phpize
$ ./configure
$ make
# make install

Başarılı bir kurulum sonucunda eklenti PHP eklentileri dizinine eklenti.so adıyla yerleştirilir. Eklentiyi etkin kılmak için php.ini dosyanıza bir extension=eklenti.so satırı eklemeniz gerekecektir.

Eğer sisteminizde phpize komutu yoksa ve RPM gibi önceden derlenmiş paketleri kullanabiliyorsanız, phpize komutunu ve PHP eklentilerini derlemek için gerekli başlık dosyalarını içermesi muhtemel uygun bir PHP geliştirme sürümünü kurmanız gerekebilir.

Komutun kullanım bilgilerini görmek için phpize --help komutunu verin.



add a note add a note User Contributed Notes Paylaşımlı PECL eklentilerinin phpize ile derlenmesi
jplahti 29-Aug-2008 02:48
Minimizing harm on upgrading extensions on busy server.

I upgraded (phpize,make... way) APC-extension on quite busy server and found out that Apache segfaults if i just restart it gracefully with the new extension in place. I found a way around this, so that the users of the server only see small slow down of the services.

1. Comment out extension loading (old extension) in php.ini (or separate .ini-file).

2. Restart Apache gracefully (now system runs without extension).

3. Replace old extension with new version (can be done already before first restart) and edit .ini again to include extension.

4. Restart Apache gracefully again (new extension loads).

Of course this only works for extensions which your php-application can live without for a short period of time. ;-)
Brian 01-May-2008 02:39
If you have multiple PHP versions installed, you may be able to specify for which installation you'd like to build by using the --with-php-config option during configuration.

--with-php-config=[Insert path to proper php-config here]

For example (my case):
./configure --with-php-config=/usr/local/php5/bin/php-config5
Glen 17-May-2007 07:07
When you have multiple installations of PHP, running phpize from a specific installation will not force the module to be compiled with that installation's include files.

In my case, I had a standard PHP distribution installed, and am evaluating Zend Core / Zend Platform, which installed it's own Apache & PHP in a /usr/local/Zend/.. install path.  It was missing the json.so module, so I had to compile my own.

Running Zend Core's phpize, the output indicates that configuration for that module will occur.  But when running ./configure, the standard installation's include files are used.  The result json.so being compiled against the wrong PHP would not load when Zend Core's php initializes.

The only way I could see to correct the situation was to temporarily change the standard PHP include path to point to the Zend Core's include files.  In my case, I made a backup copy of /usr/include/php5 and did a "ln -s /usr/local/Zend/Core/include/php/ /usr/include/php5".
dmytton at php dot net 03-Dec-2005 01: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.

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