As you already know a visit visa is for maximum 6 months.
It is not allowed for you get married or to apply a spouse visa from within the UK.
I very much doubt you will find anyone to actually perform the wedding ceremony anyway. But it's possible that you may.
Based solely on the information you provided you have now put yourself in a very tricky situation here and run a high risk of being subject to a severe immigration penalty.
May I very kindly suggest you seek the advice of an immigration advisor/specialist to help you.