If it hurts to fart you may be getting or have hemorrhoids. You should see your doctor if you think you might have hemorrhoids.
It shouldn't hurt to fart so something is wrong which is probably hemorrhoids and a doctor can help you get your hemorrhoids cleared up.