It could be due to formula milk if ur LO is not breastfeeding. Try to dilute the formula with more water or give him some mashed banana daily. It helps. :) If it’s solid food, what are u giving him? At 9 months old, u can start to feed him with some boiled water daily as it will also help to relief constipation.