How to install PDlib on your Server (for face recognition)

If you like our articles, we would appreciate a like and a comment!

Today we will show you how easy it is to install PDlib. You need this, for example, for face recognition in NextCloud, as in this article: Face Recognition in NextCloud • Schächner (xn–

If you want us to help you with the installation, please write to us!

You can also use it to fix the following error: App “Face Recognition” cannot be installed because the following dependencies are not fulfilled: The library pdlib is not available.

But let’s start right away:

First we edit a file:

sudo nano /etc/apt/sources.list.d/20-pdlib.list
There we need to add the package source at the end:

deb [signed-by=/usr/share/keyrings/delellis-archive-keyring.gpg arch=amd64] jammy jammy

After that we download the key with this command:

wget -O- | sudo gpg --dearmor -o /usr/share/keyrings/delellis-archive-keyring.gpg
That was the hardest part.

Now we still lead

sudo apt update
out and then we can take the package with you

sudo apt install php8.1-pdlib
to install.

Now we install PDlib “again” (specifically for the Face Recognition App):

For this we need some dependencies again

sudo apt-get install libx11-dev
sudo apt-get install libopenblas-dev liblapack-dev
sudo apt install cmake
sudo apt install php-dev
Then install the shared library (Dlib):

sudo git clone
cd dlib/dlib
sudo mkdir build
CD build
sudo cmake -DBUILD_SHARED_LIBS=ON ..
sudo make
sudo make install
Now for the actual installation:

sudo git clone
cd pdlib
sudo phpize
sudo ./configure --enable-debug
sudo make
sudo make install
So. We’re done with the installation. :woozy_face:

Now you only have to go into the php.ini file under the point ; dynamic extensions ; add the following content:

sudo nano /etc/php/8.2/cli/php.ini


We’re still testing that

sudo apt-get install php-bz2
sudo make test

Good luck and have fun!
Thanks for reading, Schächner

1 Like

do we need to add


in /etc/php/8.2/cli/php.ini
or can add in /etc/php/8.2/fpm/php.ini
or in both

Even after installing Pdlib and all imagick stuff
I am unable to get preview of heic
My bad luck