You can get married in England while on a student visa. You have to get a COA- Certificate of Approval- from the Home Office. Your visa has to have at least 3 months left on it when you apply for the COA, and once it's granted you can register and get married in the UK, then get FLR (good for 2 years.) You'd have to make sure you allow enough time on your visa past the three months to get the COA approved (not sure how long it takes), get married, and get your FLR approved so it doesn't expire in the midst of the process. You can get a COA only if you're on a visa that is good for more than six months, student or otherwise- you wouldn't be able to do this as a visitor or any other visa that's valid less than six months.