A magnitude 5.8 quake struck off the Solomon Islands in the Pacific Ocean, the U.S. Geological Survey said on Wednesday.