Save yourself the misery & switch back to 12.04 -
From your comments I understand that you have a project using PHP 5.3, from my experience, I had the same issue when I moved to 14.04. All my CakePHP projects failed to work. All the suggestions given here do work, I was able to install PHP 5.3 by manually building it as answered by @raaz. But trust me even if you successfully install PHP 5.3 it will have a lot of dependency issues with other packages & services like apache, mysql etc. I wasted 2 days in trying to make things work, but finally I switched back to 12.04.
Note:- For the question that you have asked i.e how to install PHP 5.3 in Ubuntu 14.04, the above methods will help you do that. But it won't solve your purpose i.e of making your application work seamlessly.
Also Refer - Installing PHP 5.3 in Ubuntu 14.04