The 20-year-old left-back worked with O’s boss Ian Hendon at Upton Park before his release in 2014, and has since been playing for non-league Dulwich Hamlet.
Hendon told the club website: “I am pleased to have Frazer on board. He’s young, eager and very energetic.
“I feel he has benefited from his spell in non-league. I think he has grown up and I had him at Under-21 level at West Ham.
“He was very good at that level but for one reason or another he drifted away from the professional game for a year but he has come back, looks strong and he is going to be physically better off because he has been dealing with men every week rather than in Under-21 football.
“To me he looks like he has developed. Technically I know what he is about and he has got to get fitter, but to be fair to him he has worked hard over pre-season, but when you have been out of the full-time game for a year it takes a bit of time to get back to how you were.”