In his heyday, he lived at 783 Bel Air Road, a four-bedroom, 5,432-square-foot Beverly Hills mansion that once belonged to John Phillips of The Mamas & the Papas.

The Tudor-style house was tricked out in his signature funky black, white and red color scheme. Shag carpet. Tiffany lamps in every room. A round water bed in the master bedroom. There were parties where Stevie Wonder, Jimi Hendrix, Janis Joplin and Miles Davis would drop by, where Etta James would break into “At Last” by the bar.

Just four years ago, he resided in a Napa Valley house so large it could only be described as a “compound,” with a vineyard out back and multiple cars in the driveway.

But those days are gone.

PHOTOS: SLY STONE

Today, Sly Stone — one of the greatest figures in soul-music history — is homeless, his fortune stolen by a lethal combination of excess, substance abuse and financial mismanagement. He lays his head inside a white camper van ironically stamped with the words “Pleasure Way” on the side. The van is parked on a residential street in Crenshaw, the rough Los Angeles neighborhood where “Boyz n the Hood” was set. A retired couple makes sure he eats once a day, and Stone showers at their house. The couple’s son serves as his assistant and driver.

Inside the van, the former mastermind of Sly & the Family Stone, now 68, continues to record music with the help of a laptop computer.

“I like my small camper,” he says, his voice raspy with age and years of hard living. “I just do not want to return to a fixed home. I cannot stand being in one place. I must keep moving.”

Stone has been difficult to pin down for years. In the last two decades, he’s become one of music’s most enigmatic figures, bordering on reclusive. You’d be forgiven for assuming he’s dead. He rarely appears in public, and just getting him in a room requires hours or years of detective work, middlemen and, of course, making peace with the likelihood that he just won’t show up.

There was a time when Sly was difficult to escape. Stone, whose real name is Sylvester Stewart, was one of the most visible, flamboyant figures of the late 1960s and early 1970s.

The multiracial, multi-gender band that Stone assembled fused funk, soul and psychedelic rock and became one of the most influential acts ever. The San Fran-based group released a string of hits beginning with the 1968 album “Dance to the Music,” followed by “Everyday People,” “Family Affair,” “Thank You (Falettinme Be Mice Elf Agin)” and “Stand!”

The group’s costumes and showmanship were just as memorable. The members favored giant afros, flashy capes, Beatle boots, neon vests and leopard-print jumpsuits.

Stone learned to sing in church as a child. He grew up in a middle-class, Christian household in Vallejo, Calif., and he and three of his siblings sang in a gospel group. As a young man, he studied music at a local junior college and worked as a soul disc jockey at a local radio station. He played in several bands with his brother, Fred, a guitarist.

The lineup of Sly & the Family Stone, which included Fred and sister Vet, solidified in 1966. The band’s energetic live shows, positive lyrics and diverse membership earned it buzz in the Bay Area, and the Family was signed by CBS Records.

Appearances on shows like “Music Scene” and “The Ed Sullivan Show” soon followed, and in the summer of ’69, at the peak of their power, they managed to turn what should have been a snoozy middle-of-the-night slot at Woodstock into one of the highlights of the festival. As the band began to play, tens of thousands of people creeped out of their sleeping bags to watch. They left the stage with the audience still roaring, “Higher!”

And then the inevitable cracks began to appear. Sly moved to Los Angeles while the rest of the band remained in the Bay Area. He started hanging around with unsavory characters. There were whispers of cocaine and PCP abuse, Mafia connections and guns being pulled on people.

Things got dark. Stone started missing rehearsals and even performances. In 1970, he failed to show up at 26 of the band’s 80 gigs and quickly developed a reputation as mercurial.

“There were these people that say I had to pay a $50,000 bond, so if I’m late, they keep the money, right?” Stone says. “It seemed that people saw to it that I was gonna be late, and I get there, and this promoter ran out and started shouting, ‘You gonna be late again? F–k you! We don’t need that s–t, man!’ I’m thinking about music, and the only time when I can play is when I am happy. So I just leave.”

Sly & the Family Stone began to fall apart. Drummer Greg Errico and bassist Larry Graham (who’s credited with creating the much-imitated slap-bass sound) bolted in the early 1970s, and by 1975 the group called it quits.

Drugs took a tighter hold. One night close to Christmas, Stone headed out to buy presents for his young son, Sylvester, whom he had with Kathy Silva, a model he married on stage at Madison Square Garden in 1974.

“I had about $2,500 to spend,” Stone recalls. “By the time I get [to the store], I had spent it all on drugs. Yes, I did. And when I getting close to little Syl’s house, I thought, ‘Oooh, man. I never should have done that.’ When I saw him, I said, ‘I spent your money up on drugs. I spend it up on dope.’ ”

Over the years, Stone has dropped tens of thousands of dollars on his other hobby: automobiles. In his early days, he drove a Jaguar XKE he painted purple. There were Hummers, a London taxi and a beloved Studebaker, which Stone asked to have painted in exchange for this interview. (The Post declined.) A few years ago, he would cruise around LA on a bright-yellow, custom three-wheel chopper. He was known to give cars to friends.

By 1980, the group’s popularity had declined enormously from its heyday. Stone appeared on an episode of “The Mike Douglas Show” and promised, “I’m going to do one more album real quick, and if it’s not instantly platinum, bye-bye.” Sly & the Family Stone’s 10th and final album, 1982’s “Ain’t But the One Way,” flopped.

Stone kept his word and mostly vanished. He was arrested a few times in the 1980s for cocaine possession and performed sporadically, but his days of sold-out shows and magazine covers were gone. A 1987 performance would prove to be his last for 19 years.

He finally reappeared during a 2006 Grammy tribute, shuffling on stage, his posture hunched and his neck bent as a result of a fall he suffered at his home. He arrived midway through a medley of his classic hits, played the keyboard and sang for a few bars, waved, then inexplicably left the stage before the song concluded.

Today, Sly is disheveled, paranoid — the FBI is after him; his enemies have hired hit men. He refuses to let The Post into his camper, but, ever the showman, poses flamboyantly with a silver military helmet and a Taser in front of his Studebaker.

The singer claims his money troubles escalated in 2009, when his royalty payments stopped flowing after Stone accused his manager, Jerry Goldstein, of fraud. Stone says he was tricked into signing a rotten contract with Goldstein in 1989, giving the manager control of his finances in exchange for a weekly paycheck.

Last year, Stone sued Goldstein for $50 million, alleging fraud and 20 years of stolen royalty payments. (Contributing to the singer’s dire financial situation, he foolishly sold his valuable music-publishing rights to Michael Jackson for a reported $1 million in 1984.)

Goldstein did not return calls seeking comment.

The performer’s cash-flow problems forced him out of his Napa Valley house that he rented with money from a 2007 European tour and into cheap hotels and the van in 2009. Stone hopes to soon put the lawsuit and his other woes behind him.

“My music is a format that will encourage you to have a song you won’t forget. That’s why I got so much money, that there are so many people around, and that’s why I am in court. Millions of dollars!” Stone says. “But now please tell everybody, please, to give me a job, play my music. I’m tired of all this s–t, man.”

Earlier this year, Stone released an album of his hits re-recorded with other artists. Stone has new songs, but he no longer trusts record companies or managers and is wary about making a deal to release another album. He works constantly on new music, often staying up for two days straight, then sleeping for the next two. (In a nice piece of symmetry, some of his 1971 album, “There’s a Riot Goin’ On,” was recorded in a Winnebago.) He has hundreds of new tracks recorded in his van that he keeps for himself. For now, at least.

“But, with new energy, it will feel good to step on stage,” he says. “I see all the guys playing those old songs. Let these guys know, like Lady Gaga, let me come in, just let me come in and pay me if you like it.”

William Alkema is the director of the Sly & the Family Stone documentary, “Dance to the Music,” to be re-released this year.