An all-optical photonic microwave frequency divider(PMFD) is presented. It is based on injecting an RF phase modulated optical signal into a semiconductor laser oscillating in the period-two state. New optical frequency components with frequency separation of half of the input RF signal frequency are generated at the laser output. A frequency divided signal can be obtained by the beating of these optical frequency components at a photodetector. Large harmonic suppression can be achieved by using an optical filter to select only two optical frequency components to be detected by the photodetector. The proposed PMFD is free of electrical components and does not suffer from the modulator bias drift problem. It has the potential to operate over a 100 GHz frequency range. System parameters required to realise divide-by-two frequency division operation for different input RF signal frequencies are investigated. Experimental results are presented for the novel PMFD, which demonstrate the generation of a 1/2 frequency component for different input RF signal frequencies by controlling the forward bias current of an off-the-shelf semiconductor laser, and which also show the important advantages of large harmonic suppression and high signal-to-noise ratio performance. Wide input RF signal power range and high output stability performance are also demonstrated experimentally.