I hiked west of Safford, AZ a couple weeks ago and looking at the route, you will be on a dirt road leading into Safford, from KlondYke*, AZ. Safford is a decent sized town with grocery stores, post offices, and the typical American fast food joints. Lots of ranches right outside the wilderness areas, so pay attention to your maps on the KlondYke road. Really sticky mud when it rains too. If you need to pitch a shelter before getting to Safford, just find a place off the road but just far enough away from any 4WD tracks (and again, away from ranches, some of which have signs allowing access but no camping - there's a ridgeline with a sunrise view that I like if you PM me). Seemed like more ranches plus mining concerns towards Clifton/Morenci AZ but didn't go that way (just passing through the other way actually).
More public lands approaching the AZ-NM border; Glenwood NM is a smaller town with a good BBQ place + a post office before you dig into the Gila Wilderness. Gila Hot Springs has a good general store. It didn't seem there was much in Magnadelena NM though.
(* the profanity filter picked up the ghost town of KlondYke, but a capital letter fixed it... jeez)