He has got constipation so I would suggest you to feed him bananas , plenty of fluids . Pain is probably due to anal fissures.
You can apply lignocaine gel over rectal area.
If pain persists consult a doctor , you might need to take stool softeners .
Next Steps
drink plenty of water eat bananas
try syrup duphalac