Every magazine on a newsstand is, by name, a warehouse. The word meant a storehouse for centuries before anyone printed one.
It starts with Arabic makhzan, "storehouse" or "granary," from a root khazana, "to store up." Merriam-Webster traces the English word to the plural, makhāzin. A short history in the South China Morning Post follows it around the Mediterranean. Latin magazenum, "storeroom," turns up at Marseilles in 1228. Italian magazzino is recorded from 1348.
French made it magasin, "warehouse, depot, store," in the 15th century. Etymonline takes the French from Italian, while Merriam-Webster routes it through Old Occitan. Spanish took the Arabic with its article attached, as almacén, "warehouse."
English had the word by the 15th century. Merriam-Webster gives that date for the storehouse sense, and the Post names 1451. Etymonline's first date is later, the 1580s. Armies then narrowed it. By the end of the 1500s a magazine meant a store of arms, ammunition and explosives, and a ship or fort had its powder magazine. From 1868, the Post says, it also meant the detachable cartridge holder in a repeating rifle.
The reading sense is younger, and it has a single inventor. In January 1731 the London printer Edward Cave launched The Gentleman's Magazine. Wikipedia says he was the first to use the word for a periodical. The first issue's full title, according to the radio series Engines of Our Ingenuity, promised "a Collection of all Matters of Information and Amusement." According to the Post, Cave described it as a "Monthly Collection, to treasure up, as in a Magazine," the most remarkable pieces on its subjects.
The idea was a storehouse of writing gathered from everywhere. Cave edited it under the pen name Sylvanus Urban, and the young Samuel Johnson found his first regular writing job there. The magazine ran for almost 200 years and stopped altogether in 1922.
The name caught on so well that it swallowed the older meaning. Today the warehouse sense has faded, but the rifle and the glossy monthly still share a word for a place where things are stored.