First:
./configure --with-apxs2=/usr/local/apache2/bin/apxs \
--with-config-file-path=/user/local/apache2/conf/php.ini \
--with-curl=/usr/lib/ --with-mysql=shared --with-mysqli=shared \
--with-zlib --with-gd --with-jpeg-dir=/usr/local/lib/ \
--with-freetype-dir=/usr/lib/ --enable-soap --enable-pdo=shared \
--with-pdo-mysql=shared --with-sqlite=shared
...
make
...
make install
...
libtool --finish /sources/php-5.1.6/libs
Second:
PHP needs to know where to load the extension from.
You can tell it to search the directory you've noted by editing your php.ini as follows:
extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20050922/"
give your exact path
Read More...