I had just installed php8.1.12 on a machine used for writing C code.
Below are some libraries that I needed to download on a debian-based OS.
apt-get install libpcre3 libpcre3-dev
apt-get install apache2-dev
apt-get install libxml2-dev
apt-get install libsqlite3-dev
These were the missing packages that I required.
If you get an error regarding a missing package or library, for example when I needed sqlite3, run the command:
apt search sqlite3
And you'll be able to see if there's any dev or lib packages.
The apache2 instructions worked flawlessly at the time of php8.1.12; and in order to get certain requirements for an application, I had to run the php configure file like so:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-pdo-mysql --with-mysqli --with-zip --enable-gd
The extra flags allowed me to use both types of mysql, allowed me to utilize PHP zip archiving, and allowed me to use Gnatt stuff.