Search code examples
phpphp-extension

How to install libpuzzle for PHP on Ubuntu 12.04 machine?


I'm trying to install libpuzzle PHP extension but I don't seem to be able to get it to work.

I have tried to follow the following instructions:

The Puzzle library can also be used through PHP, using a native extension. Prerequisites are the PHP headers, libtool, autoconf and automake. Here are the basic steps in order to install the extension:

(on OpenBSD: export AUTOMAKE_VERSION=1.9 ; export AUTOCONF_VERSION=2.61)

cd php/libpuzzle

phpize

./configure --with-libpuzzle

make clean

make

make install

If libpuzzle is installed in a non-standard location, use: ./configure --with-libpuzzle=/base/directory/for/libpuzzle

Then edit your php.ini file and add:

extension=libpuzzle.so

However when I try to run "./configure --with-libpuzzle" I get the following error: configure: error: Please reinstall the libpuzzle distribution

Could someone point me in the right direction please.


Solution

  • Is there a reason you are compiling from source when it is available in the Ubuntu repositories?

    sudo aptitude install libpuzzle-php
    

    Or apt-get if you like that instead:

    sudo apt-get install libpuzzle-php
    

    If you somehow did not see it in the repository do a search like this:

    sudo aptitude search libpuzzle
    

    Which on my 12.04 install shows this:

    p   libpuzzle-bin                 - quick similar image finder - runtime tool                               
    p   libpuzzle-bin:i386            - quick similar image finder - runtime tool                               
    p   libpuzzle-dev                 - quick similar image finder - development files                          
    p   libpuzzle-dev:i386            - quick similar image finder - development files                          
    p   libpuzzle-php                 - quick similar image finder - PHP bindings                               
    p   libpuzzle-php:i386            - quick similar image finder - PHP bindings                               
    p   libpuzzle1                    - quick similar image finder - shared library                             
    p   libpuzzle1:i386               - quick similar image finder - shared library