October 26, 2022 | 12:35pm

Matthew Perry revealed that he had a big crush on Jennifer Aniston – both before and during “Friends” – but she allegedly turned him down.

In his new memoir, “Friends, Lovers and the Big Terrible Thing,” the actor writes that he met Aniston prior to filming the hit sitcom and was “immediately taken” by her presence.

Perry remembers at one point calling up Aniston and trying to impress her with exciting news that he booked two acting roles.

“It was clear that this made her think I liked her too much, or in the wrong kind of way,” he writes in the book, out Nov. 1.

Still, he proceeded to ask her out.

Perry claims Aniston declined the offer and suggested they just be friends instead, to which he blurted out, “[We] can’t be friends!”

Perry gushed that he was crushing on Aniston way before “Friends.”
Ron Davis

The two eventually sat down for their first table read in 1994, and even though Perry still had some romantic feelings towards her, they “were able to sail right past the past and focus on the fact that we had both gotten the best job Hollywood had to offer.”

Unfortunately for Perry, his feelings for Aniston continued throughout the making of “Friends.” He says he frequently found himself over analyzing every casual interaction the two of them had.

Perry’s feelings for Aniston slowly but surely went away due to both the show’s success and her continued “deafening lack of interest” – although they did share an onscreen kiss on the Season 3 episode “The One with the Flashback.”

The “Whole Nine Yards” star wrote that by the time Aniston had begun dating Brad Pitt in 1998he had “long since gotten over her” and figured out how to interact with her “without it being awkward.”

Perry, 53, had also moved on with other romantic relationships – most notably briefly dating Julia Roberts in 1995. He dumped Roberts, 54, after two months of dating because he was “certain that she was going to break up with me.”

“Why would she not? I was not enough; I could never be enough; I was broken, bent, unlovable. So instead of facing the inevitable agony of losing her, I broke up with the beautiful and brilliant Julia Roberts,” he confessed.

In addition to his massive rise to fame, Perry was alsobattling drug and alcohol addiction. He had to go to rehab twice during the sitcom’s filming from 1994-2004.

Perry admitted that after filming the iconic momentwhere his character, Chandler Bing, married Monica Geller, played by Courteney Cox, he was “driven back to the treatment center … in a pickup truck helmed by a sober technician.”

The actor estimates he spent around $9 million fighting his addiction over the years, and even after that, he “nearly died”a few years ago when his colon burst and doctors told him he had a “2 percent” chance of survival.

“My therapist said, ‘The next time you think about taking OxyContin, just think about having a colostomy bag for the rest of your life,’” hetold Peoplelast week. “And a little window opened, and I crawled through it, and I no longer want OxyContin.”

Perry has been sober for the last 18 months.