My son had the same problem when he was younger... But he was also a pickier eater too. He loved milk, cheese and chicken nuggets and pizza. Unfortunately, the food he WOULD eat tended to 'plug' him up too. I also believed it also got to the point of being psychological...how could it not though??? This is painful stuff for a little one to deal with! So he stopped even trying to have a BM because it was such a stressful means to and end. Not to mention it meant he'd have to stop playing! So, of course it compounded things and complicated things much worse for him in the long run.
Our pediatrician finally prescribed Miralax...to get his bowels and intestines moving into a regular pattern again. That was an excellent way to start off and get going in the right direction... This stuff pretty much forces the BM. Which in turn got him to forget about the stress in having BMs (the pyschology stress is gone). And also it helped to get his intestines back into a normal size for his age. As I'm sure his intestines were so badly stretched out and had grown/stretched completely too big for his little body to let the BM even exit his body. Then, we eventually started in onto independent measures...and leaving the Miralax behind. Getting many more fiber and healthy foods into his diet...daily if not hourly...is so important.
Besides adding more fiber and produce. Here's some assisting dietary items to utilize instead of Miralax... Prune Juice is good...however my son tired pretty fast of this taste. However, Pear Juice is great!! -- Gerber's makes this. Though it is hard to find! Then, as he got older... We noticed that Rainbow foods sold a 3-pack of 100% Juice 'Tree Top' brand - Apple Pear juice boxes. These worked awesome! Then, also noticed that Hi-C puts pear juice in their 'Grabbin' Grape' flavor juice boxes as well. So, that helps somewhat too. Now I'm not at all an advocate for kid's drinking juice all...but this stuff did definitely worked for him! So, I think 'the end does justify the means' in this case. Also, CUB Foods in our area many times has decent fresh Bartlett Pears in their produce section. So, whenever I do see they look good....I stock up! Wait til they ripen to desired flavor/texture...then they store fairly well for awhile in the fridge. My son LOVES these (course he prefers them without the peel). But I prefer him eating actual pears to drinking juice. Also, if you can get him to eat Grapefruit (with sugar on top to entice him) and oranges or mandarine oranges (canned is fine)...this also will help him out. Unfortunately, many boys are not that great at eating produce compared to girls.... So, you definitely have to actively work at on incorporating this stuff into their diets whenever possible. I've even heard of people mashing and putting veggies into their spaghetti sauces. Or putting vegetables masked into their desserts...like brownies!
I also read an article written by a pediatrician up in Duluth...he gave his child a handful of chocolate covered raisins daily. The child thought it was a treat, but in reality he was also devouring raisins with lots of good fiber too.
Lastly, you'll need to definitely increase daily a clear type of fluid intake. The more water or clear liquid the better(heard someone mention Gatorade...that probably would work. Though be careful as I'm not sure how good ingesting a ton of salt-laden liquid is that good for the small ones). Lots of liquid helps the intestines out a TON and will help soften everything to help it pass much easily through his system too.
Best of Luck!