I got the same problem, but along with
"libssh2_session_set_read_timeout" was not found in DLL "C:\xampp\php\ext\php_curl.dll"
I resolved the issue using the method described above.
https://github.com/php/php-src/issues/16794#issuecomment-2476165187
So the "nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation" issue could be solved with the same logic.
Just copy the nghttp2.dll under php folder, then use it to replace the one under apache/bin, everything would just work perfectly.