I'm standing in the Wingohocking Creek Sewer, the largest in Philadelphia's sewer system. Picture a drain pipe that's big enough to drive a bus through. In one direction is the darkness of the sewer, with several feet of raw sewage running through it. In the other direction is a giant hydraulic door called a Pelican Gate, which covers most of the opening, with just a small slit on top. And just on the other side of the door is Frankford Creek.

This is the end of the line—what they call an outfall point. I asked to see this spot because it's a pivotal point in Philly's troubled infrastructure. Normally, the system can handle all of the waste generated by the 38,000 homes that feed into this particular sewer. But when storm water gets into the pipes and mixes with the waste, sewage levels rise too high too fast and threaten to back up into basements and pop manhole covers in the streets. To prevent that smelly calamity, this giant gate has an opening at the top so that, like bleeding a wound, the excess sewage can pour out into the creek. It's only an issue when it rains, but in Philly, that's 70 to 80 times a year.

"You can catch fish there, too. I just wouldn't eat them."

A week earlier, when it rained in the city for four days straight, the spot where I now stand would have been absolutely covered in raw sewage. I look around the massive pipe expecting to see dirt, debris, human feces, some sign of the mess, but there's little evidence of it here: a condom wrapper, a few bottles, and some soda cans, along with bits of rope and bottles and wrappers along the walls and the hinge of the hydraulic door. You can sense dirty water has been here. There's a thin layer of silt and detritus that you don't want to touch, like strands of someone else's hair left behind in a drain. Even so, the floors and walls are eerily clean, like a crime scene that's been hastily cleaned up.

My hosts lower the gate to show me its capabilities. I walk out onto the edge of the outfall and look out into the creek. It's crystal clear. I see the sandy bottom and the colored leaves that have fluttered to the floor. There are tadpoles flitting by. I'd swim in there.

"I wouldn't," says Michael Horger, a technician in the water department's flow control unit. "You can catch fish there, too. I just wouldn't eat them."

Caren Chesler

Sometimes the hue of Frankford Creek is more honest. Vincent Haughney, a machinery and engineering mechanic with the water department, says just after an outfall—when untreated sewage has poured out over the top of the gate—the creek actually changes color.

As well it should. Because of the antiquated way in which Philly's sewer was constructed, everything people flush down their toilets or throw in the street can wind up in the sewer system. When it rains, all of that grossness can wind up in Philadelphia's rivers and streams, like the Frankford. Chris Crockett, Deputy Commissioner of Planning and Environmental Services for the Philadelphia Water Department, knows firsthand. When his field workers are out sampling water quality after a rainstorm, they'll find toilet paper and condoms wrapping around their legs and clothing. It's not a great selling point for a city trying to get its citizens to spend more time in kayaks and canoes, boating and fishing along Philadelphia's waterways.

"It's a problem because one, it smells, and two, it's not just full of trash. It's full of diapers, condoms, some of the nastiest of the nastiest, and people are going to see it," Crockett says. "We're in the 21st Century and we're trying to get to Mars. How can the fifth largest city in the U.S. still have sewage going into all its streams and rivers, millions of gallons in any given rainstorm? And some people are out there swimming in it. What's the difference between that and swimming in a toilet?"

I turn away from Frankford Creek and look out into the darkness of the sewer main. There's about six feet of water in the main, though the floor level rises up under the water like the ocean floor, and it's as if I'm standing on the sand looking out into the water. I can hear the muffled sound of water flowing from one level to another, like a waterfall. As sewage from homes and businesses come rushing through the system, it heads toward this outfall point, but just before it gets here, the flow is diverted into an intercepting pipe through two little holes in the main called sluice gates, like two fang holes in the side of a large straw. The water rushes through those gates with such speed, I'm told not to go near them.

Caren Chesler

"If you get too close to those gates, you're gone," says Horger, the water department technician. "You'd get pulled right down by the force of the water and carried all the way to the [wastewater treatment] plant, and that would be the end of you."

I'd think my hosts from the water department were trying to scare me, but then I hear the water rushing by and suddenly I feel weak-kneed at the thought of falling in and being whisked off in a river of shit. It's not far-fetched. Two people actually died after falling into the Philadelphia sewer system in the 1980s. One was a teenage boy who entered the Rock Run sewer with his friends, about a quarter of a mile up the Tacony Creek from where I'm standing. Authorities believe he tripped and hit his head, tumbled unconscious into the sewer, and then washed downstream via the intercepting sewer to the treatment plant. His body was found a day later at the sewage treatment plant.

I step back a little farther from the sluice gates.

Caren Chesler

The Philadelphia sewer system is built like a tree. It's a network of small pipes called laterals that run from peoples' homes to a main pipe that travels down the middle of each street. The street pipes then feed into larger arteries, all of which terminate in a main pipe, like branches feeding into the trunk. And as with a tree, the pipes getting progressively larger as you move from a home to a street to a main artery. The laterals, for instance, are about four inches wide, while the pipes that run down the streets are about five feet wide. The Wingohocking Creek Sewer I visited is 21 feet tall and 24 feet wide.

If you lined up all the pipes in Philadelphia's sewer system, it would be 3,716 miles long, roughly the distance from New York City to Los Angeles. Because sewer systems use gravity to carry waste from peoples' homes and businesses to their final destination in the wastewater treatment plant, the pipes often follow stream and creek beds, as they are good indicators of which way water naturally flows. The treatment plant for the Wingohocking Creek Sewer is in Juniata because it's one of the lowest points in the city. There are only 30 places in Philadelphia's sewer system where gravity doesn't work, and in those spots, pump stations push the sewage up from one pipe to another.

I feel weak-kneed at the thought of falling in and being whisked off in a river of shit.

Like many older cities in the U.S., Philadelphia has what is called a combined sewer system. Unlike in more modern cities like Austin or San Diego, where the storm water pipes are separate from the sewage pipes, in Philadelphia the two run together. Sometimes there's too much flow for the system to handle. It hasn't helped that since these old sewers were built much of the land in cities has been paved over, making far more storm water than the system's creators had anticipated. There's another problem with the outmoded Philly system: Once sewage and water are combined, the whole mixture must be treated.

"There's an old adage: What do you get when you mix a gallon of sewage and a gallon of storm water? You get two gallons of sewage," Crockett says.

On dry days, there's no problem. Sewage moves easily from people's homes, through the main trunk, through the sluice gates, and into the intercepting sewer that carries everything to the Northeast Water Pollution Control Plant about 2.8 miles down the road. But when it rains, storm water pours down the drains that dot Philadelphia's streets and mixes with the sewage already in the pipes, filling the system to capacity. Think of a sandcastle when a wave rushes in.

Sewage only flows out over the top of the Pelican gate if interim measures don't work. The first line of defense is to monitor the water level in the intercepting sewer, and when it reaches a certain level, the sluice gates are shut so that the water is held captive in the sewer main. Today, for instance, the sewage level in the intercepting sewer is at 2.7 feet. When it reaches 4.7 feet, the sluice gates are shut and the sewer main in which I'm standing begins to fill up. With the pelican gate closed, the main acts as a temporary holding tank. It's only when the sewage level in the main reaches about 12 feet that it begins to flow out over the top of the gate and into the creek, but it only takes about 0.1 inches of rain to cause an overflow. The larger the storm, the larger the overflow. Crockett says that during Hurricane Floyd in 1999 there was so much sewage pouring out of the top of the gate it looked like whitewater rapids. Sewage was coming out so forcefully it was reaching the opposite bank of the creek and eroding it.

On a typical day, the system handles about 471 million gallons of waste, though it can handle as much as a billion gallons a day if necessary. If the total goes beyond that, the excess flow must be released somehow. Last year, some 11 billion gallons of sewage was released from the system and dumped into local waterways, untreated, because it was more than the system could handle. In colonial times, it was standard practice to dump waste into the harbor or throw into the streets and let the rain wash it into sea. People figured the sea was deep and large, and anything dumped there would disappear or dissolve. We now know that's not the case. The only upside to the release is that it prevents sewage from backing up into people's homes. Most of the time.

"The only time you'd see that happen is in a hurricane, where, literally, there is so much storm water rushing in, the whole system is at capacity, and it might pop open a basement fixture, like a utility sink or a floor drain, or even a toilet, if there's one down there. That happens in all these big cities," Crockett said. "Basically, in most cities if you get two inches per hour of rain and throw in a high tide, the opportunity for basement flooding is likely."

The federal government's Environmental Protection Agency considers cities that have combined sewer systems, like Philadelphia, to be in violation of the federal Clean Water Act. Many have entered into consent decrees with the agency, in which both parties agree on a settlement or plan and a court supervises its implementation, so that they're not fined every year for breaking the law. At the end of fiscal 2014, 193 sewer systems throughout the U.S., each of which serve more than 50,000 people, had entered into consent decrees or consent orders with state or federal authorities, according to the EPA.

Caren Chesler

Philadelphia can't just rebuild all the infrastructure under its streets. So the city came up with a clever plan as part of its agreement with the EPA. If the problem is too much storm water in the system, why not try to absorb some of it before it enters the pipes?

Philly started a green infrastructure plan, conceived in 2000, to install thousands of rain gardens and tree trenches throughout the city, almost a frequently as you would see a manhole cover or street drain. Both are designed to collect runoff from impervious surfaces such as roofs, walkways, and parking lots, allowing water to infiltrate the ground and provide plants and tree roots with better access to air and water. The plan also includes the installation of porous pavement in places like basketball courts and hundreds of green roofs, all of which will absorb the storm water before it can run down storm drains and flood the sewer system. The project, financed by ratepayers through their wastewater and storm water bills, is expected to cost $2.5 billion and will be implemented over the next 25 years.

"We're literally doing 12,000 acres of green infrastructure, or 19 square miles. It's the most comprehensive green infrastructure in the U.S., if not the world," Crockett says. "It's the equivalent of tricking the hydrology so it looks like 43 percent of our pavement or hard surfaces disappear. And in doing that, we're getting rid of 9 billion gallons of sewage overflows into our waterways by controlling the storm water at the source."

Crockett says the city is on track to exceed its target of 744 greened acres in 2016, a figure that is expected to reduce sewer overflows into local waterways by more than 600 million gallons a year. The city's goal is to have 9,564 greened acres—about 15 square miles—by 2036. "We expect to be 10 percent of the way there this year," Crockett said.

Caren Chesler

The green infrastructure is being installed on public land, such as parks, playgrounds, schools, streets and vacant lands, as well as on private land both residential and commercial. While residential property owners can sign up for a program called "Raincheck," and get free rain barrels and financing for landscape improvements, commercial property owners are required to reduce their storm water runoff. Existing non-residential property owners will be billed "storm water charges" based on their impervious area. For instance, a one-acre parking lot will cost about $5,000 a year. But if the property owner manages their storm water, they can get a credit that will reduce their bill by up to 80 percent. In addition, the city is giving out $10 to $15 million a year in grants to businesses that retrofit their properties to reduce storm water runoff. On new construction, developers must make sure their buildings can handle the runoff from the first 1.5 inches of rain that falls in any storm. Anything to keep the water out of the sewers.

The $2.5 billion price tag is not cheap. But the alternatives aren't great. Philadelphia can't rebuild its colonial sewer system, and another option—building a tunnel to store excess sewage, which is what Chicago, San Francisco, and Washington, D.C. are doing to beat their sewer system woes—could cost $8 billion or more.

"It's the equivalent of tricking the hydrology."

"We're very pleased with the efforts the city has taken. It's not only increased the environmental quality of the city, but it has economic benefits. This is a less costly way of addressing the problem," said Mike Helbing, staff attorney for PennFuture, an environmental advocacy group, noting that creating more green space results in more trees, shade, recreation areas and a better aesthetic in a city.

The program makes so much sense that neighboring Camden, N.J., has copied it. Camden has built 50 rain gardens and created two parks—one out of an old gas station and another out of an abandoned factory. It's also cleaned out old sewer lines where a layer of silt had diminished the amount of volume the pipe could hold. "We've captured close to 100 million gallons of storm water each year," says Andrew Kricun, Executive Director of the Camden County Municipal Utilities Authority. "It's made a difference, but we really need to capture ten times that number."

Camden officials also put nets over its outflow pipes to catch solids like human feces and debris before they can enter the water. They were required to by state law. Pennsylvania, meanwhile, has no such law, despite the city's big move to clean up its sewer. And so, in 152 places around Philadelphia, when it rains everything and anything that's in the sewage system could end up in rivers and streams near the city where people play and picnic.

"These are the same streams that when it's not raining, Philadelphians are happy to wade in," Crockett says.

Caren Chesler

We leave the sewer and climb back up an 18-foot ladder and set of rungs, the equivalent of two stories, and go out into the street. We're now going to go down the manhole that's out in front of the building so I can get a better view of the sluice gates, this time, from on top of them.

They remove the manhole cover, which is some four inches thick and about 110 pounds, with a pick axe, angling the cover slightly over the hole in the street. They then push it onto a metal pipe and use the pipe like wheels to roll the cover away from the opening. They put a metal apparatus that looks like a walker over the hole.

The entrance is only about two feet wide. Haughney goes down first, and I follow right behind. There's no ladder. You have to climb down metal rungs that are attached to the wall, but the first rung isn't close enough to the top, so you must hold the walker-like apparatus. As I dangle my foot into the hole, looking for the first rung, the only thing holding me up is my hands, which are clinging desperately to the metal apparatus, and the only thing holding the metal apparatus in place are the two water department workers holding it down.

At the bottom I find a big metal grate that serves as a landing. Underneath us is the sewage pouring through the sluice gates. If the main trunk I was standing in earlier was the large straw, I'm now standing above the two fang holes or sluice gates in the side of the straw, as the sewage shoots through the holes and lands in the intercepting pipe that takes it to the wastewater treatment plant. The rushing water sounds like a jet engine. It's hard for us to hear each other.

"That's why we didn't want you to get too close to the gates!" Horger shouts over racket.

There's a stink down here, but it's not what I expect. I anticipated the stench of human waste, but the smell is more like rotten eggs or the methane gas emitted by a landfill. In fact, the gases emitted by the sewage are such a danger that workers must carry meters with them when they go underground. If the gas levels become too high, they can explode.

Haughney says he's had to go down into the waters below to fix an electrical malfunction on the sensors that operate the sluice gates. He wore a harness and cables, in case he fell in and the pressure of the water threatened to carry him away.

"Certain things aren't designed for human occupancy," he said.

Philadelphia's waterways are among them. For now.