我正在尝试编译 pHash 扩展。我在这里找到了一个很好的分步解释,https://serverfault.com/questions/491730/compile-phash-on-centos-php-extension
但我遇到了两个问题:
1) 启动 pHash 源的 ./configure 脚本时,日志显示以下错误,尽管我在 /usr/local/include 文件夹中复制了 CImg.h
*** Configuring image hash ***
checking CImg.h usability... no
checking CImg.h presence... no
checking for CImg.h... no
checking whether CImg.h is in the current or src directory.... no
这真的很糟糕,因为我对 pHash DCT 图像哈希算法功能最感兴趣
2) 启动 make 时 pHash 编译失败并出现以下错误:
../src/.libs/libpHash.so: undefined reference to `pthread_create'
../src/.libs/libpHash.so: undefined reference to `pthread_join'
collect2: ld returned 1 exit status
make[2]: *** [test_texthash] Error 1
make[2]: Leaving directory `/home/downloads/libraries/pHash-0.9.6/examples'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/downloads/libraries/pHash-0.9.6'
make: *** [all] Error 2
知道为什么会这样吗?如上面链接中所述,我确保满足所有依赖项。我想尝试使用 pHash-0.9.5,但在 phash.org 网站上找不到旧版本存档