Skip to content

Installation

Debian / Ubuntu

Install the prebuilt package from GitHub Releases. The .deb ships the extension and enables it for your system PHP via phpenmod.

bash
wget https://github.com/AllanGallop/libphp_imagehash/releases/latest/download/php-imagehash-amd64.deb
sudo apt install ./php-imagehash-amd64.deb

Restart PHP or your web server if the extension does not show up immediately (for example after installing under PHP-FPM or Apache).

TIP

The package targets amd64 Linux. See releases for version-specific artifacts.

Install manually

If you prefer not to use the .deb, download a prebuilt extension from releases (for example php_imagehash-linux-x86_64-php83.so) and add it to php.ini:

ini
extension=/path/to/php_imagehash-linux-x86_64-php83.so

Restart PHP or your web server after changing php.ini.

Build from source

For development or platforms without a release artifact:

bash
git clone https://github.com/AllanGallop/libphp_imagehash.git
cd libphp_imagehash
cargo build --release

Then load the built extension in PHP.

WARNING

The exact extension filename and PHP config path depend on your build environment. Replace the paths with your real output path.

ini
extension=/path/to/libphp_imagehash/target/release/libphp_imagehash.so

Verify

bash
php --ri imagehash

or:

bash
php -m | grep imagehash

Native tools, weird experiments, and practical performance work.