Assuming that the future Louis XV dies in 1714, as was suggested before, how about this: Philip goes back to France to defend his rights. By that time he already had a seven-years-old son (who would be his heir Louis) and an infant son (the future Ferdinand VI). So, one plan would be to make the one-year-old Ferdinand as king of Spain under a regency, while Philip and Louis go back to France.
But Ferdinand would be too young, and with all his other descendents dead Louis XIV might want Ferdinand in France too, as a reserve in case his eldest brother dies. Also, if Ferdinand is made king then Philip would need to rely on a long regency for his son in Spain, and as he is in France he wouldn't have the power to control all the regency's decisions in Madrid. So, the other idea (I'm not sure how likely would be though) is a compromise agreement. France recognizes the Habsburg claim but, considering that Spain still doesn't follow Salic Law (and they make it sure to be remembered, because no one would want a union between Spain and Austria again) they only accept as the monarch of Spain the eldest daughter of Joseph I, Maria Josepha of Austria. She would only marry IOTL in 1719, and her husband would be Frederick Augustus II of Saxony. But IOTL they would probably find other husband to her (and it would be cool, as Spain would be under a totally different dynasty).
Any ideas for a compromise king consort of Spain? I have a suggestion: in order to please the Duke of Orleans, and as sign of compromise, Maria Josepha is married to the duke's son,
Louis of Orléans. A Bourbon is on the Spanish throne, but he is not likely to inherit the French throne, something the other powers would gladly accept.