Not a PHP framework per se, but you can use something like osm2pgrouting (or equivalent) to get a nodes and edges graph database into Postgresql. And PHP has plenty of routines for accessing Postgresql including the use of postgis stored database routines which can do the routing/distance calculations.

That said, I have had issues with osm2pgrouting with larger datasets, so getting the OSM road network into a nodes and edges routing database may best be done with some other program.