The deal is worth $21 million, a source told ESPN's Adam Schefter.
The Bills have both of their starting defensive ends from last season, Jerry Hughes and Shaq Lawson, under contract for next season. Lawson, the Bills' first-round pick in 2016, missed the final four games of last season with an ankle injury.
Also Wednesday, the Bills announced signing former New York Jets linebacker Julian Stanford to a two-year deal.
The Bills pressured opposing quarterbacks on 24 percent of pass plays last year, the second-lowest percentage in the league, according to ESPN Stats & Information research.
Murphy, 27, missed last season after tearing his left ACL and MCL in an Aug. 10 preseason game at Baltimore. He was already going to miss the first four games while serving a suspension for violating the NFL's policy on performance-enhancing drugs.
A second-round pick in the 2015 draft, Murphy did not produce as much in his first two seasons, totaling six combined sacks. He started 22 games during that time.
ESPN's John Keim and Mike Rodak contributed to this report.