I can not install php with freetype support [Ubuntu]

I am trying to install php from source again and I have done it several times by now. I really need freetype support, and when I try to compile php everything is alright except for the freetype.
PHP VERSION: 8.0.1
Error: configure: WARNING: unrecognized options: --with-freetype-dir
terminal command:
sudo ./configure --prefix=/usr/local/php --with-mysqli=mysqlnd --with-apxs2=/usr/local/apache2/bin/apxs --with-jpeg --with-zlib --with-kerberos --enable-gd --with-freetype-dir=/usr/local/freetype2/ --with-freetype
Answer
Solution:
From the manual
To enable support for FreeType 2 add --with-freetype-dir=DIR. As of PHP 7.4.0 use --with-freetype instead, which relies on pkg-config.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: string literal contains an unescaped line break
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.