Before he made it big in TV and movies, Jim Carrey was a struggling stand-up comic, telling jokes for no money, getting heckled for his trouble and, at one point, living in a closet.

Now those experiences and others inform the Showtime’s series he’s executive producing. Set in the Los Angeles comedy scene in 1973, I’m Dying Up Here premieres June 4 at 10/9c.

We got him to reminisce about the highs, lows and lunacy of earlier days…

“During the next person’s act I crawled through the crowd on my hands and knees, got up behind the piano and sang ‘I hate you all! You gave me cancer’ until all of the audience left. I had many things thrown at me.”

Do you remember your first gig?
Yuk Yuk’s Comedy Club in Toronto, my first break. Tickles and Berry was a huge one for me as well. I got a big review there. I did it for free. I always tell people who are starting out to do it for free, do it anywhere you can.

What was your worst gig ever?
I had so many crazy gigs. There was one night at the Comedy Store where the crowd hated me so much that I decided to defiantly stay on stage for two hours. During the next person’s act I crawled through the crowd on my hands and knees, got up behind the piano and sang ‘I hate you all! You gave me cancer’ until all of the audience left. I had many things thrown at me.

Do you think fondly of those days?
Yeah. When I watch this TV show it really hits me in my heart because it was a beautiful place to be, I knew that I was a part of something special. I started in Toronto. We heard about Robin Williams and Steve Martin and all these guys in the clubs and it became an avenue, we could follow that lead. It really felt like a magical thing to be a part of. I had so many incredible experiences. But I’m lucky to be alive, really.

What was your act like?
I used to freak the audience out a lot. I’d play cockroaches and a vacuum cleaner and stuff like that.

“Oftentimes it wasn’t who was funniest on stage; it was who was funniest at the bar or who was funniest in the parking lot. That’s what mattered to comics.”

How has your sense of humor evolved over the years?
I have no idea. It’s always been the same to me. It’s always what’s not allowed, what everyone’s thinking and not saying and how you come out with it. Like at The White House Dinner, where you say what everyone’s thinking and kind of bring everybody back down to earth and bust everybody out of their monkey suits. That’s been my role for years. That’s all I want. All I want is to love people and be loved. That’s really all that anybody wants.

Why did you get involved with I’m Dying Up Here?
For years I’ve wanted to do something about this era, to represent this time and place. It’s an incredible cast, and they really captured the feeling of the era and the camaraderie and the competition and the smart‑ass quality of being a comic. Oftentimes it wasn’t who was funniest on stage; it was who was funniest at the bar or who was funniest in the parking lot. That’s what mattered to comics. I’m getting a really good feeling out of putting somebody else in the spotlight and see them do such a great job. The show has substance and is thoughtful and compelling. I really hope that we get another season to see where these guys go.

Some of your own experiences end up in the script. Examples?
I lived in a closet when I first came to L.A. I met somebody at the Improv who said they had a room, and it turned out to be a closet. So for the first year or so I was here, I lived in that closet, like Larry and Eddie do in the show. The very first morning that I lived in the house, I walk out in the kitchen and found a beautiful young girl making bacon with no pants on. And I went, ‘Wow!’

Larry and Eddie are hell-bent to get on TV—even a silly game show.
Andy Kaufman and Bob Saget, all of these guys back then, they did The Dating Game all the time, and they did Let’s Make a Deal. They went on any television show they could get on that they could showcase their personality and make some money.

“I met somebody at the Improv who said they had a room, and it turned out to be a closet. The very first morning that I lived in the house, I walk out in the kitchen and found a beautiful young girl making bacon with no pants on. And I went, ‘Wow!’ ”

We also see in the series how The Tonight Show was the Holy Grail for comedians. What’s your memory of it?
I lost The Tonight Show a couple days after I got to Los Angeles. I was a big deal in Toronto, and they booked me on the show, but I did a showcase at The Improv and I had kind of a lukewarm night, and then I heard the news that I had lost the spot. It could have been the end of me, and I could have perceived it that way, but my brain has always had this fail‑safe space that goes, ‘I don’t know how, but it’s going to happen a different way.’ I ended up on The Tonight Show maybe six months later because I got a television show to promote.

It’s amazing how important it was back then to comics because they respected Johnny and they wanted his okay. If Johnny liked me, man, it meant something to me. It was, like, ‘Wow, I’m not only good at what I do, but he thinks I’m intelligent, and he likes talking to me.” It was the same with David Letterman. Letterman had the same power over people. He could slaughter you, if he wanted to, in a moment. His opinion was important because he’s a sharp guy.

Now with social media, comedians don’t have to be anointed by a TV host because they can make online videos.
Yeah, there’s a lot of great advantages for people who would never get a shot before. There’s a lot of different avenues. But the cream rises to the top in every venue, you know. There’s a lot of junk to sift through and you’ve really got to have stuff that cuts through the clutter. The people that stand out are the people that go on to have longevity.

Do you miss stand-up? Want to return to it?
No. I’m in the process of shedding layers of persona at this time in my life. So I’m very happy to be here for these guys and watch them enter this world and create these characters. But I loved being on the road. I still love being on the road if I do a movie.

Photo: Dan Steinberg/Showtime