BRIDGEPORT, Conn. — This state’s law approving the sale of marijuana for medical purposes has been on the books for two years, but the drug is still not available.

Among the challenges has been finding dispensing locations acceptable to Connecticut towns and cities. Fairfield and West Haven let applicants for licenses to operate dispensaries know they would not pass zoning muster; other municipalities, including Madison, New Canaan and Westport, have imposed moratoriums of as long as a year while their zoning rules are reviewed; and this month the Bridgeport zoning board turned down a licensee.

The law, signed by Gov. Dannel P. Malloy, a Democrat, in May 2012, requires that a pharmacist dispense the drug, and limits the list of qualifying ailments. Four manufacturers and six dispensaries have so far been licensed.

Yet even with the restrictions, those who are trying to open the facilities are running into opposition from residents who are concerned that a dispensary nearby would reduce the stigma for children to try marijuana, invite black markets or lower property values.