Not a very geometric approach to this problem, but nevertheless gave a correct result, or at least the one that looks fine when plotted.
Anyway, find all the vectors connecting point P to the line L, all of them being a function of t (your parameter). This is pretty simple. Now, calculate the length of such vectors. Actually, length squared will do as well. This again is a function of t, isn't it? Now, what you want to find is the shorthest from all those vectors. So what do you do? Yep, you are looking for a minimum of the latter function. Once you find the value of the parameter, for which a vector LP is the shortest, you are at home :)
We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling We Value Civility
• Positive and compassionate attitudes
• Patience while debating We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving