It looks as if you will have to leave and apply from outside the UK.
http://www.ukba.homeoffice.gov.uk/vi...when-to-apply/
If your existing permission to stay has expired
If you are already in the UK and your permission to stay expires more than 1 month before the start date of your proposed course of study, you must return overseas and apply from outside the UK. If you apply from inside the UK, we will refuse to extend your permission to stay.