I would like to know if there is any repository I can add to install php5.2.9+ on Ubuntu Server 12.04.
PHP 5.2 was sent to end of life in December of 2010, so while there's a small chance you might find a PPA or .deb file in some dark alley of the Internet, you're very likely going to have to compile it from source if you want it to run on Ubuntu 12.04. Additionally, it's possible you'll run into problems with dependencies (particularly if anything has changed their API), so keep that in mind.
That said, you can find the latest source for the PHP 5.2 series on their GitHub (I found the 5.2.17 tag for you), and compile it using
As a side note, it might be worth putting pressure on the people that maintain your external application to upgrade to at least the 5.3 series, or better yet, the 5.4 series. There have been a ton of bug fixes and security patches since then. Additionally, most tools don't support 5.2 anymore (which means you don't get things like Xdebug or PHPUnit without a fight, making maintaining an application of decent size and reasonable importance damn near impossible (I've been there)). The upgrade may not be something that can be done right away, thanks to changes between 5.2 and 5.3, but it generates customer demand and helps break down the delusion that a lot of companies have of "well, our userbase doesn't want this, so we're not going to offer it" (even though the reason they don't demand it is because it was absent from the product and they found workarounds, nevermind the fact that if the product offered it, the customers would use it).
I had never done it on Ubuntu, but yes in Debian Squeeze using the respository of Debian Lenny.
As the packages of PHP are all from Debian I think that this tutorial will server for Ubuntu.
I repeat... not tested... just what i do on Debian ...
Original source: http://www.gustavopilla.com/2012/01/21/php-5-2-en-debian-squeeze/