My first one had issues with constipation for her first 2 years or so. Food/water changes didnt seem to help. Then we found out about Glycerin suppositories. They are totally safe. They make them in two sizes/doses, adult and kid. Our doc said for a baby under 1 to use half a child dose, once over age 1 use a whole one. I was kind of nervous! But we did it, she was only a month old the first time constipation became an issue, and we used them on and off for the next 2 years.
Its NOT a medicine. All it does is melt inside of them, soften up the poop, and makes it easy for them to push out. Once she got older, granted, putting a suppository in wasnt her favorite thing to have done, but it was worth it to have her fill her diaper with 2-3 days worth of backed up yuck! Sometimes we had to use them every couple days for a week or so, then she would get back to normal.
Now we have had kid #2 and used them a couple times with her too. With this one, just the act of putting it in makes her push a lot harder and that gets things going, it rarely even has a chance to melt.