The best scenario with hanging cabinets on drywall is securing them to the studs behind the wall. Even if not every screw holding the cabinet in place sinks into wood, if the majority of the weight is held by the studs, the cabinets will stay secure. Use a stud finder to locate the studs before you start, and mark them all with a pencil. Alternatively, a thin nail pounded across the wall in a straight line every couple of inches will also show you where the studs stand.
If you use strong toggle bolts, you can still install cabinets in the absence of studs. The weight of the cabinets held firmly against the wall should rest easily as long as the drywall is 1/2-inch thick or more. Of course, simple things like choosing lighter cabinets and storing heavy objects in the floor cabinets will keep the anchors from pulling out from the wall.
Reinforce the wall by building a brace that connects to the existing studs. This brace should be solid wood and securely fastened into the studs. When you are ready to screw your cabinets to the walls, the brace will transfer the weight to the studs instead of the drywall. You will have to trim out the gap between the cabinets and the wall, but your cabinets will be secure.
If just one cabinet is lacking in support from studs, you can secure it to the surrounding cabinets. A bottom strip of wood will support the base of the cabinet against the wall. Screwing the cabinets through the side frames transfers the weight to the outer cabinets, making it basically a solid unit.