If you already got a PHP installation setup, you may need another extension/module from the PHP source tree.
You can build and install that single module from the source while keeping the rest of the PHP installation intact, but the documentation of building shared PHP modules is poor.
In my case I needed the tidy extension, and here’s how to do it
$ # extract the PHP source code and enter the directory
$ ./configure --with-tidy=shared
$ find . -name tidy.so
Then copy the tidy.so file to the modules directory of the PHP installation.
The important part here is the shared keyword, which is poorly documented. I had to inspect a RPM spec file to figure it out.