Sharapova came through her first-round match unscathed after she beat Spain’s Kaia Kanepi 6-2 6-4.
Sharapova appeared unwell during her victory on Philippe Chatrier as she coughed and spluttered between points. Her illness resulted in her skipping the traditional on-court post-match interview, thus earning boos from the Court Philippe Chatrier crowd.
The Russian said that was not unexpected but said she had to “do what you got to do”.
Quizzed about her illness, she insisted it was not a major problem.
“It’s just the way it is. I’m getting over it and hopefully it will pass by soon,” Sharapova said.
“It was really the least of my worries today. It’s such a big occasion obviously for me to be out, back on centre court, and I had a tough opponent ahead of me.
“I wanted to win the match but I knew it was going to be tough and it wasn’t going to depend on the tennis.
“The conditions were pretty difficult as well, so overall I’m just happy I got through and to have a day off tomorrow and I should be better by then.”
Seven-time grand slam champion Williams is out after she lost 7-6 (7/5) 6-1 in the all-American clash with Sloane Stephens.
Williams, who was seeded 15th in the draw, made more than twice as many unforced errors as her 22-year-old opponent, who will now play Britain’s Heather Watson in round two.
Eighth seed Carla Suarez Navarro is also into the next round after she beat Romania’s Monica Niculescu in straight sets.