Make sure he is getting plenty of water and fiber. I believe it's Gerber that has small bottles of Apple-Prune juice, you can find it in the baby food aisle. My son's ped. recommended giving him this to drink when he was constipated, or if he will eat them baby food prunes. Just be careful not to over-do it.
i never had any success with prune juice, or with the baby food prunes.... but cooking prunes on the stove with a mix of 1/4 part apple juice and the rest water, and then blending it up to baby food texture has always worked! i mix it up with some applesauce or mix it into oatmeal and my girls love it.
make sure he's not eating a lot of bananas, cheerios, cheese, rice, or other binding foods like that. offer more things like strawberries, raisins, apples, etc. give him a lot of water or very watered down juice to drink.
My daughter went through a phase of this around the same age but it was my fault. It was warm out and I was giving her too much milk and although she drank quite a bit of water, it wasn't enough. It is usually caused by diet or lack or water.
My daughter has done this since birth and she will be two this month my doctor told me to mix brown sugar in some water and have her drink it or buy the brown sugar karo and mix with water and it works rather quickly also fruit juice does the it for her to but the brown sugar karo never let me down and they love it.