In a sprawling tent encampment in Gaza, the Israeli bombs fall close enough to hear and feel. But daily life is also a struggle against hunger, cold and a growing sanitation crisis.

A lack of sufficient toilets and clean water, as well as open sewage, are problems that displaced Palestinians have struggled with since the early days of Israel’s assault on Gaza.

For two months after Salwa al-Masri, 75, and her family fled to the city of Rafah, at the southernmost tip of Gaza, to escape Israel’s military offensive, she said she would walk 200 yards to reach the nearest bathroom. If she was lucky, younger women in line would let her jump ahead. Other times, she might wait up to an hour to use a dirty toilet shared with thousands of other people.

“It’s horrible,” Ms. al-Masri said via WhatsApp recently from her family’s ramshackle tent, which they made out of wood and plastic sheeting. “I wouldn’t drink water. I would stay thirsty so I wouldn’t have to go to the bathroom. I stopped drinking coffee and tea.”

Many other Gazans, already facing hunger and thirst as a result of Israel’s more than four-month siege of the territory, say they, too, have tried to cut back on eating and drinking even more to avoid an uncomfortable and unsanitary visit to the toilet.

Recently, Ms. al-Masri’s son and other relatives bought a cement toilet basin and dug a hole behind their tent, where the sewage gathers. It is a closer bathroom and one she shares with fewer people.