We use both and they have different meanings but both are correct depending on what you want to mean.
Example:
- Él va a hacer todo lo posible PARA que vayas a la fiesta // He will do his best for you to go to the party (A goal you want to get)
- Ella va a hacer todo lo posible POR ir a tu fiesta // She will do her best to go to your party (A motivation for doing something)
Maybe it is a little confusing but if you practice and read more examples you're gonna start to understand better the use cause there are many more uses for POR and PARA, the one you posted is only one of them.