By 2009, Laura Ziskin had earned the kind of credits that open exclusive doors in Hollywood.

Her long record of successes included producer credits on blockbusters such as “Pretty Woman,” “As Good as It Gets” and the original “Spider-Man” trilogy, but she had little luck in finding financial backers for “The Butler.” Major studios passed on a film based on the life of Eugene Allen (and inspired by a 2008 Washington Post article by Wil Haygood). As a White House butler who served eight presidents, Allen had a unique, up-close view of history in progress, as both his country and his family wrestled with major issues from the 1950s through the 1980s.

So Ziskin turned to Lee Daniels, her chosen director for the film, to help raise money independently. Daniels had done this many times before, most notably for “Precious,” his 2009 box office hit that brought him best picture and best director Oscar nominations. Together, the duo pulled in more than $20 million and set about making “The Butler” on their own terms, even as Ziskin suffered through and eventually succumbed to breast cancer in June 2011.

“When the studios all told her no, she was terminal but refused to accept it, and so did I,” Daniels said in his private trailer near the set Oct. 1, the final day of filming. “And so she said . . . ‘How do we do this together? Because this movie has to come to light.’ ”

The memory of Ziskin choked him up. He paused, wiped his tears and continued: “She quit ‘Spider- Man’ for me, and we worked on this film together on her death bed.”

Around the corner from Daniels’s trailer at the historic Gallier Hall, the city’s old administration building, a few members of the star-studded cast remained, shooting final scenes of a White House state dinner. There was Forest Whitaker as Cecil Gaines, the butler at the heart of the film; Melissa Leo as Mamie Eisenhower; Robin Williams as President Dwight Eisenhower; and Cuba Gooding Jr. and Lenny Kravitz as fellow butlers.

They represented just some of the big names who worked on the production. Oprah Winfrey, who plays Gloria Gaines, the butler’s wife, had wrapped up her scenes and left the city, as had an array of A-listers and Oscar winners who accepted small roles just to be part of film, including Terrence Howard, Jane Fonda, Vanessa Redgrave, John Cusack, Alan Rickman, Mariah Carey and Clarence Williams III.

After Ziskin’s death, making the movie became something between a mission and a movement. One star after another fell in love with the story and signed up, almost uniformly accepting far less pay than usual, and in some cases even losing money by clearing busy schedules and canceling tour dates to be on set. Legendary composer Quincy Jones came on board to do the music. And suddenly, there was a bidding war for a film that previously had scant interest.

In May at the Cannes Film Festival, where filmmakers try to sell their films to domestic and foreign distributors, “The Butler” far exceeded expectations, scoring big deals in countries including France and Japan, while also reinvigorating domestic interest. Four companies competed to distribute the film in the United States, with the Weinstein Co. eventually prevailing and preparing for a fall 2013 release.

The script, written by Daniels with Emmy Award winner Danny Strong, sticks close to the facts but veers in some instances for creative purposes. For example, the Allens had one son, Charles, who consulted with Daniels and visited the set. But the script called for a second son to portray generational tension during the Civil Rights movement through the relationship between that son, who takes to the streets to protest, and his more reserved father.

More than 2,000 extras were hired for scenes that capture seminal moments in U.S. history from the second half of the 20th century. Small details were given great attention — the crew even found an authentic Woolworth’s counter in an antique store to recreate a scene from the 1960s student sit-ins protesting segregated lunch counters in the discount store.

“It’s quite emotional actually to witness,” said Haygood, an associate producer of the film. “Lee Daniels has brought a very expansive and heartfelt vision to this American saga.”

The day after Haygood’s story appeared in The Post in November 2008, an executive at Sony Pictures passed it on to Ziskin and her production partner, Pam Oas Williams. They immediately obtained the rights to make the movie. Director Steven Spielberg initially showed interest, but in the end Ziskin brought in Daniels. Sony and other studios backed off when they didn’t agree with the broad vision that Ziskin had for the film or the amount of funding she was seeking.

“It was really interesting to have what we thought was a really strong package but be told that the economics for an African American period drama about politics was not what the studios were making, and that if we could scale the story way back and do it for a low dollar, it could be made,” Williams said. “But it was an epic story. How do you scale it down?”

Daniels put it this way: “I think that is a statement to what the studios feel about black Americans and what their worth is . . . what they will go see, that we don’t want to see ourselves at all, unless its a $6 million or $7 million movie. Things have not changed at all in Hollywood.”

To raise funds, Ziskin decided to target wealthy African Americans for financing. That brought her to Sheila Johnson, who as vice chairman of Monument Sports Entertainment is a managing partner of the Washington Mystics and the only African American woman to have ownership in three professional sports teams, including her interests with the Washington Wizards and Capitals.

“I was mesmerized by the story,” said Johnson, also chief executive of Salamander Hotels and Resorts. “I read the script and was just blown away.”

Johnson immediately agreed to kick in the first $2 million and to recruit other investors. “I went to celebrities. I went to rappers, everybody I could get my hands on,” Johnson said. “Everybody loved the script, and then I’d wait, and nothing happened.”

Eventually, Johnson approached retired professional basketball player Michael Finley, who pitched in investment funds. Slowly, the rest of the money starting coming in chunks — half a million here, a million there. Ziskin even hosted meetings in her home with interested investors, including a woman from Compton who had won the lottery. By then, the producer was so weakened by her cancer that she was reduced to making her pitch and dragging herself up to bed before the meeting ended. On June 12, 2011, just a few weeks after bringing Johnson on board, Ziskin died in her home.

When Johnson last visited the set Sept. 30, she couldn’t help but think about Ziskin and how the rest of the team had soldiered on to get the film made. “I got very emotional with Lee,” Johnson said. “I had to leave to get back to my real job. We just held each other.”

The finish line is in sight, with Daniels saying that he will spend the next few months editing and “making the magic happen.” This was the first time Daniels has directed a family-oriented film with a PG rating and the confines that come with it. Any adjustments have been well worth it, he says.

“I hope I honor this gentleman, this very, very beautiful man,” Daniels said of Allen, who died in 2010. “I want to honor him and everybody who’s helped and served our country. Then I’ve done my job.”

Lisa Frazier Page is a former Washington Post reporter and editor, who lives and works as a freelance writer in the New Orleans area.