When trying to compile PHP 8.4.x PHP FPM custom selector throws error saying "zlib-dir" is a dependency of zlib which in 8.4.x zlib-dir or zlib-develop is baked into PHP version 8.4.x to my knowledge. This missing dependency doesn't allow PHP-FPM to be compiled with custom settings because of the missing zlib-dir dependency.
From what I can tell from research is that zlib-dir is no longer needed in PHP8.4.x and should not be throwing the error. Compiling without zlib does not allow gzip page compression, so this is a deal breaker.