To upgrade Debian OS from 7 to 8 by itself.
The last one might be run twice if needed.
apt purge linux-image-3.2.0-4-amd64 -y
You might have to purge all php packages and reinstall them, and find extension directory by
php -i | grep extension_dir and edit it manually to