“Cannot execute boolean operation” when subtracting several spheres and cylinders from cube
Cases where boolean operations can fail:


Overlapping geometry between objects:
Multiple vertices in the same location will often cause the boolean modifier to act up.
From this bug report:


  this is a known bug in Carve upstream (a library we're using for boolean operations)

Self intersecting objects:
Boolean operations with non-manifold objects or objects that are not water-tight will fail when non-manifold parts interact in the boolean operation.


Some things you can try:

Add supporting geometry. The boolean operation creates a lot of tris, so this might make subsequent operations difficult.

For example:

The spheres boolean causes this mess of tris where the cylinders will go:



However, if you add some loop cuts around the spheres:



The tris are contained in the center, keeping the topology clean where the cylinders intersect:



With modeling tools

You can get the result with conventional modeling too:


Add a sphere and two cylinders (the cylinders are just guides)
Rotate and move then into position using increment snapping (Ctrl) to keep everything precisely aligned:


Snap the 3D cursor to the sphere object by selecting (in object mode) it and pressing ShiftS> Cursor to Selected
Press . (period) to set the pivot to the 3D cursor
Enter edit mode with the sphere active and delete these elements with X or Delete> Vertices:


Scale the 45 degree edgeloop along the X and Y by pressing S and then ShiftZ, then holding Ctrl to snap until the edgeloop at 45 degrees touches the intersection at the two cylinders:



The cylinders are no longer useful after this step, so you can delete them.
Select the vertices as shown:


Extrude along the X axis (EX):


Set the pivot to Bounding box center (,) and scale the selection to 0 along the X by pressing SXO (zero):


Do the same for the other side:


Add a mirror modifier and enable X and Y:


With the sphere active, enter edit mode and select all (A), then move it so the object origin is not in the middle of the sphere:


Before:


After:



Enable Clipping in the mirror modifier and move each edge so it merges with the mirrored geometry:




You can then use this for the boolean operations:



Here is the blendfile.