Why not use an existing version control system?
There are several open source version control systems available, some of the stable ones include CVSNT and Subversion. You can also consider Bazaar-NG, darcs and monotone.
If you do absolutely need it as a web interface, I suppose PHP could be used to contruct a (limited?) frontend for the version control backend that you choose.
Alternatively, you can implement the check in/out system and revision control yourself with a database keeping track of the checkouts and by storing the revisions wholesale, but then you may suffer space and flexibility penalties, among other potential problems.