An angular analysis of the decay $B^0 to phi K^*(892)^0$ is reported based on a $pp$ collision data sample, corresponding to an integrated luminosity of 1.0 fb$^{-1}$, collected at a centre-of-mass energy of $sqrt{s} = 7$ TeV with the LHCb detector. The P-wave amplitudes and phases are measured with a greater precision than by previous experiments, and confirm about equal amounts of longitudinal and transverse polarization. The S-wave $K^+ pi^-$ and $K^+K^-$ contributions are taken into account and found to be significant. A comparison of the $B^0 to phi K^*(892)^0$ and $bar{B}^0 to phi bar{K}^*(892)^0$ results shows no evidence for direct CP violation in the rate asymmetry, in the triple-product asymmetries or in the polarization amplitudes and phases.