It may be hard to find something like this for free, but tr.im was/is planning on releasing their source code on Sept. 15th. I am not 100% sure if they still are, but that is what they stated a few weeks back.
There's a few out there, but they all seem to be missing some features that others have, nothing seems to be all inclusive. I ended up writing my own at one point and setting it up as a service. It was a nice little project, and surprisingly, it seems to be used (somewhat) though mostly by (as far as I can tell) spammers. Hah.
It really all depends on what features are the most important to you, and you can go from there as to which package would be the best. If you want a couple resources of reviews, let me know, and I'll see if I still have the research notes from the one I built (tracked down and tried to basically build whatever features all the others had into one single setup, heh.)
Edit: The names I have off hand of other scripts are Phurl, Kissa.be, Shorty, Linx, PHPurl, though all their feature sets seemed quite limited to me. I'd even thought of some stuff that I'd not seen elsewhere.
Last edited by WO-Jacob; 09-06-2009 at 11:48 PM.
Reason: Added names of scripts
Jacob - WebOnce Technologies - 30 Day 100% Satisfaction Guarantee - Over 5 Years Going Strong! Website Hosting, PHP4&5, RoR, MySQL 5.0, Reseller Hosting, Development, and Designs