The rapid expansion of cities during the 1800s brought the problems greatly to the fore. London had sewers long before that, but they were..... inadequate.
Paris and London had 'cloak-men' plying their trades. For a half-penny, the cloakman would shield you from view, whilst you did what you had to do, upon the street.
Then came the great reformers of plumbing, Joseph Bazalgette, the man who designed a totally new sewer system for London saved more lives than all the medical pioneers of his age put together.
That aside, our cities are still under-served by public sanitation. And people still pee in the streets. Men are the worst offenders, after a few drinks too many, but women are not blameless, by any means. The problem? Alcohol makes you pee copiously, but often the desire to do so does not occur until you've left the premises, and then, no business welcomes people who just come in to use the toilets, public facilities are frequently vandalised, filthy, and abused, so maintenance costs are high, and cities close them rather than shoulder the running costs.
Some cities have tried to address the problem with these portable urinal stalls. The ones here are deployed in Amsterdam, but cities around the world now use similar ones, especially in the peak tourism/festival season.
(On a personal note? Argh! No way would I, could I use one. Gak! Put a wall around it!)....
However, a couple of weeks ago, I visited the railway museum in Darlington, which makes a museum exhibit of its old toilets. And I found Victorian forbears of these modern devices, which are uncannily similar, just not moulded out of plastics.