ANAHEIM, Calif. — Mohammed Aly does not see why he shouldn’t try to ease the lives of Orange County’s homeless. But the authorities — and many of his neighbors — disagree.

Aly, a 28-year-old lawyer and activist, has been arrested three times as he campaigned on behalf of street people. Recently, he was denied permission to install portable toilets on a dried-up riverbed, site of an encampment of roughly 400 homeless.

“It is a question of basic empathy,” he said.

But his detractors are engaged in a debate up and down the West Coast as the region struggles to cope with a rising tide of homelessness. They say Aly and other well-meaning residents who provide the homeless with tents, toilets and hot meals are enabling them to remain unsheltered.

And they note, nuisances like trash and unsanitary conditions fester and aberrant behavior continues.

In California, the San Diego County community of El Cajon passed a measure that curtails feeding the homeless, citing health concerns. Los Angeles city officials have closed and reopened restrooms for those on Skid Row amid similar controversies.

The issue is hotly debated in Orange County. In the seaside enclave of Dana Point, neighbors fear a nightly meal is drawing homeless to a state beach where teens play beach volleyball and families picnic and surf. And on the riverbed 30 miles north, a van fitted with shower stalls pulls up to help those living in the trash-strewn encampment, which neighbors worry is becoming more entrenched in an area where they once jogged and biked.

“There’s no doubt that giving them stuff there prevents them from a desire to move,” said Shaun Dove, a 46-year-old soon-to-be retired policeman who lives less than a mile away.

The number of homeless living in Orange County has climbed 8 percent over the last two years. In the United States, homelessness rose slightly in the last year to nearly 554,000, pushed up largely by increases on the West Coast, federal data shows. The increase is driven by soaring housing costs as well as a drug crisis and need for mental health services.

Advocates say the homeless have become more visible as police have cracked down on rules barring camping, driving people to spots like the riverbed, which is county property.

Everybody knows the solution is more housing; there aren’t enough beds available in a county with a median home price near $700,000.

In Dana Point, the nightly meals began more than two decades ago at local churches but were moved to the beach parking lot after a late night stabbing between two homeless residents.

The homeless say as much as they appreciate the hot meals, the food isn’t keeping them on the streets.

“It doesn’t help me tomorrow. It doesn’t,” said a 55-year-old man who refused to give his name. “But it helps me today.”

Volunteers say the homeless are drawn to beaches because of the open space and access to water and restrooms and that feeding people can build trust and lead them to additional services.

But Brian Brandt, a 55-year-old lawyer, doesn’t let his six children go down to the beach alone after seeing volatile outbursts among the homeless and frequent police calls.

“I don’t want to be seen as a bad guy — ‘OK, look at this heartless dude,’” he said. “I don’t feel safe. I don’t feel like my kids are safe.”

Toni Nelson, who co-founded a neighborhood group, is also critical of the meals. She has joined with housing advocates to try to raise money to house the homeless with ties to the community, figuring if about a third of the city’s residents chip in $68 they can cover much of the need for a year.

So far, dozens have signed up to give. But they still have a long way to go.