Since the camera is not moving in this shot, before bringing your character on the set, capture one image of the background, where the entire scene is going to take place.
Select your image, make an inverse selection and delete.
Another alternative option is, instead of erasing, create a layer mask. Using Layer Mask you can also bring back your deleted area anytime. It just hides the area and will not really delete it. This way you can also recall the shadows. Take a soft brush with the lower opacity and get the shadows.
So here are your final images: