Here is a nice article from International Journal of Computer Applications Technology and Research, https://ijcat.com/archieve/volume7/issue10/ijcatr07101003.pdf, on text mining digital libraries with OKAPI BM25. The authors successfully used a PHP implementation (XAMPP bundle).
Happy to see in reference 22 of the article that they cited one of my tutorials, on the BM25F implementation. This one is available at http://www.minerazzi.com/tutorials/bm25f-model-tutorial.pdf (and through researchgate.net).
The authors generously included some PHP snippets so it should be easy for those that can code to follow up.