Was having the same problem.
Migrated the virtual machine arround without any luck.
Did what was advised at:
1) Install php5-dev, libmysqlclient15-dev and the source of php5 (apt-get source php5)
2) cd php5-5.2.6.dfsg.1/ext/mysql/
3) run "phpize" in this directory
4) ./configure && make && make install
All is fine now.