At the Rhawnhurst Cafe in Northeast Philadelphia, city inspectors found 53 people, including a DJ, enjoying prohibited indoor dining as employees and customers mingled without masks.

Employees and customers also weren’t wearing masks at the Black Taxi in Fairmount, according to an inspection report, and there was a crowd at the takeout window.

And at Golf & Social on Delaware Avenue, inspectors found the staff was not enforcing social distancing or limiting the number of people inside.

The three restaurants were among seven establishments that Philadelphia Health Department inspectors shut down earlier this month as it enforced coronavirus regulations. All three have since been inspected again and permitted to reopen. And they offer insight into the challenges city officials face as they attempt to limit the spread of the virus while allowing outdoor dining and other business activities to resume.

Health Commissioner Thomas Farley said last week that many restaurants are following guidelines, and that the city only issued seven orders to cease operations out of a few thousand inspections. But he urged owners and residents to take the guidelines seriously, reminding them that tables must be spaced so diners themselves are seated six feet apart — as opposed to placing the tables six feet apart and leaving chairs closer together.

“I’ve actually been around and walked around and seen a number of restaurants that are following those safety precautions very well, and that’s great to see,” Farley said. “We want all our restaurants that have outdoor dining to do that safely.”

For the first few weeks after outdoor dining began June 12, the city didn’t actually enforce the new rules, instead “pleading with business owners to take this seriously,” as Farley said last month.

But enforcement is underway this month. In addition to issuing the cease-operations orders, city officials have levied 19 fines on restaurants for operating outdoor dining without valid sidewalk-cafe licenses. Streets Department officers have also issued 89 warnings since outdoor dining began.

Indoor dining is still not permitted in Philadelphia, despite opening in the rest of Pennsylvania. Local officials cite concerns that masks cannot be worn while eating and that new cases of COVID-19 are rising in the city. Farley has said indoor dining, previously put on hold until at least Aug. 1, is unlikely to resume soon. The reopening of indoor dining and bars has been blamed for outbreaks in numerous states.

But restaurants can obtain permits to expand seating on sidewalks for outdoor dining into parking spaces and streets.

» READ MORE: People with disabilities say outdoor dining is making it hard to get around in Philly: ‘There is no room for us’

To check that restaurants have valid sidewalk cafe-permits and are leaving space for pedestrians, the Streets Department has sent teams to educate business owners and issue warnings and fines.

They issued 89 warnings as of last week, and 19 violations for $75 each for operating without sidewalk-cafe permits. The Streets Department has responded to 57 complaints and conducted 164 inspections since the start of outdoor dining, said Michael Carroll, deputy managing director for transportation, infrastructure and sustainability.

The Health Department, meanwhile, has been responsible for inspecting for compliance with COVID-19 health-related protocols, such as proper social distancing, the wearing of masks by staff and customers, and plastic glass barriers at cash registers.

Those inspections are conducted at the same time as regular Health Department inspections of restaurants. Farley said an additional 621 inspections have been completed since May 1 in response to specific complaints.

“It’s not just the city’s job to enforce regulations,” said Paul Levy, president and CEO of the Center City District, noting that businesses should encourage one another to self-police.

The city’s Commerce Department has led weekly calls with neighborhood business improvement districts to educate and update leaders on the pandemic and related guidelines.

» READ MORE: Face masks are required on SEPTA. Now if only more riders would comply.

The Health Department is also inspecting gyms, which reopened last week. Out of 12 gyms inspected last week, only one was found out of compliance, with a client not wearing a mask. That gym immediately corrected the problem and passed inspection, the city said. Some other businesses, such as hair salons and barbershops, are regulated by state inspectors, city spokesperson Lauren Cox said.

Levy said there is some confusion for business owners on the differing city and state guidelines. That makes self-enforcement important, he said, adding that just one business making a mistake can hurt others if it causes an outbreak.

“On one hand, no one wants to play mask and COVID police,” Levy said. “On the other hand, it’s absolutely essential that people follow rules so that we don’t get the spiraling out of control that has happened in other cities.”

Levy said outdoor dining has been successful for restaurants in Center City, with many already planning to purchase heaters in order to continue into the fall.

But with the safety and timeline for indoor dining uncertain, Levy said, and outdoor dining still considered too risky for some residents, takeout will also remain essential for most restaurants’ survival.

That raises another challenge on Philadelphia’s narrow streets and sidewalks: making space to safely allow outdoor seating while also providing a safe area for customers awaiting takeout orders.

“We’re in this improvised-each-day state of mind,” Levy said.