quoted from source:
"Usually the problem is the shift interlock system is malfunctioning. The system has an actuator mounted at the base of the steering column that determines when the brake pedal is depressed and releases the gear selector. This prevents shifting the car from park into gear unless your foot is on the brake. Before you go to any expense checking this, try opening the plastic cover around the shifter and spraying a good dose of WD-40 all around the shift linkage as your problem may just be a sticking part in the mechanism. If this doesn’t work, you’ll need to have the actuator checked out by a mechanic. Most cars and trucks have an emergency release which is a hole near the shifter or a button under the plastic shifter housing. You insert your key into the hole or press the button, shift into neutral and start the car. Then you do not put the shifter back into park until you get the car to the mechanic to fix the actuator."