matiasdelellis / facerecognition

Nextcloud app that implement a basic facial recognition system.
GNU Affero General Public License v3.0
500 stars 45 forks source link

pdlib api mismatch #726

Closed mosK1T0 closed 2 months ago

mosK1T0 commented 4 months ago

I've tried to install Face recognition but pdlib is driving me insane. I have tried to install it with this guid and I also came across this comment in another issue (closed). The problem seams to be, that pdlib is not compiled for php8.2 (and php8.3 I guess) . Here the output I get when I try to load a model:

PHP Warning:  PHP Startup: pdlib: Unable to initialize module
Module compiled with module API=20210902
PHP    compiled with module API=20220829
These options need to match
 in Unknown on line 0

You do not meet the dependencies to install the model 1 (Default)
Summary: The PDlib PHP extension is not loaded
Please read the documentation for this model to continue: https://github.com/matiasdelellis/facerecognition/wiki/Models#model-1

Server configuration

Logs

Background task log with debug.

sudo -u apache php occ -vvv face:background_job ``` PHP Warning: PHP Startup: Unable to load dynamic library 'pdlib.so' (tried: /usr/lib/php/20220829/pdlib.so (/usr/lib/php/20220829/pdlib.so: cannot open shared object file: No such file or directory), /usr/lib/php/20220829/pdlib.so.so (/usr/lib/php/20220829/pdlib.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 1/8 - Executing task CheckRequirementsTask (Check all requirements) System: Linux System memory: 8181395456 PHP Memory Limit: 4294967296 Clustering backend: PHP (Not recommended. Image Backend: Imagick Seems there are no installed models. Please read the documentation about this: https://github.com/matiasdelellis/facerecognition/wiki/Models#install-models and install them with the 'occ face:setup --model MODEL_ID' command. Fill an issue here if that doesn't help: https://github.com/matiasdelellis/facerecognition/issues Task CheckRequirementsTask signalled we should not continue, bailing out ``` -> because pdlib.so is in /usr/lib/php/**20210902**
matiasdelellis commented 2 months ago

Hi @mosK1T0 Installing by pecl today is the easiest, but from what I see, you probably have several versions of pdlib installed. And something compiled with an older version of PHP is causing you problems

mosK1T0 commented 2 months ago

Thank you. The problem was phpize not using the right API version. For everyone with the same error:

git clone https://github.com/goodspb/pdlib.git
cd pdlib
phpize<Your PhP-Version e.g. phpize8.2>
./configure --with-php-config=<Path/to/your/php-config> (e.g. /bin/php-config8.2)
make 
sudo make install