It could be a faulty brake pedal switch or, faulty gear shift interlock solenoid. Obviously, try not putting it in P but, if you do get stuck, undo the star shaped screw at the top left side of the J-gate. Insert your ign key or pen/scredriver etc and push down slightly until you feel a slight resistance while, with your other hand, moving the gear selector out of P.