Search code examples
phpcompilationphp-5.3

Needing an explanation regarding PHP extentions


Here is a quick overview:

I just finished compiling PHP 5.3.5 and made the attempt to compile "--with" a number of different extensions. Among the extensions that I need are mbstring and intl. I can manually phpize, configure, make, make install the mbstring extension and it seems to work fine. However, I am unable to do the same for intl.

My ./configure line looks like this:

./configure --with-openssl --with-pcre-regex --enable-calendar
            --with-curl --enable-exif --enable-ftp --with-gd
            --with-mhash --enable-mbstring --with-mysql --enable-zip
            --enable-intl --with-icu-dir=...

The code compiles without problem: ./configure... make, make install

I used the php.ini-production for my php.ini configuration and I configured Apache to use php-cgi for a specific domain, and that works fine as well.

A quick:

<?php phpinfo() ?>

reveals that I am in fact running the newer version of PHP. However, the extensions specified in the "./configure..." line do not show up anywhere on the PHP info page.

After a bit of scouting I found that I could run phpize on a single extension in the PHP source folder, then compile a build of the specific module and install it in my PHP extension directory. After adding:

extension=MY_EXT

in my php.ini, the extension showed up on my phpinfo() page.

So can anyone explain why --with-mbstring doesn't seem to have an effect on my compilation?

I had no compilation problems for the intl extension, but moving the intl.so file to my PHP extensions directory and adding an extension line in my php.ini has no effect.


Solution

  • From php.net, have you tried

    If your ICU is installed to a non-standard directory then you might want to specify its location in LD_LIBRARY_PATH environment variable so that dynamic linker can find it: $ export LD_LIBRARY_PATH=/opt/icu/lib

    Otherwise, if PHP and ICU are installed to their default locations, then the additional options to `configure' are not needed.