We present and release photometric redshifts for an uniquely large and deep sample of 522286 objects with i ^ { \prime } _ { AB } \leq 25 in the Canada-France Legacy Survey “ Deep Survey ” fields D1 , D2 , D3 , and D4 , which cover a total effective area of 3.2 \deg ^ { 2 } . We use 3241 spectroscopic redshifts with 0 \leq z \leq 5 from the VIMOS VLT Deep Survey as a calibration and training set to derive these photometric redshifts . Using the “ Le Phare ” photometric redshift code , we devise a robust calibration method based on an iterative zero-point refinement combined with a template optimisation procedure and the application of a Bayesian approach . This method removes systematic trends in the photometric redshifts and significantly reduces the fraction of catastrophic errors ( by a factor of 2.3 ) , a significant improvement over traditional methods . We use our unique spectroscopic sample to present a detailed assessment of the robustness of the photometric redshift sample . For a sample selected at i ^ { \prime } _ { AB } \leq 24 , we reach a redshift accuracy of \sigma _ { \Delta z / ( 1 + z ) } = 0.037 with \eta = 3.7 \% of catastrophic errors ( defined strictly as those objects with \Delta z / ( 1 + z ) > 0.15 ) . The reliability of our photometric redshifts is lower for fainter objects : we find \sigma _ { \Delta z / ( 1 + z ) } = 0.029 , 0.043 and \eta = 1.7 \%, 5.4 \% for samples selected at i ^ { \prime } _ { AB } = 17.5 - 22.5 and 22.5 - 24 respectively . We find that the photometric redshifts of starburst galaxies in our sample are less reliable : although these galaxies represent only 18 % of the spectroscopic sample they are responsible for 54 % of the catastrophic errors . An analysis as a function of redshift demonstrates that our photometric redshifts work best in the redshift range 0.2 \leq z \leq 1.5 . We find an excellent agreement between the photometric and the VIMOS-VLT deep survey ( VVDS ) spectroscopic redshift distributions at i ^ { \prime } _ { AB } \leq 24 for the CFHTLS-D1 field . Finally , we compare the redshift distributions of i ^ { \prime } selected galaxies on the four CFHTLS deep fields , showing that cosmic variance is already present on fields of 0.7 - 0.9 deg ^ { 2 } . These photometric redshifts will be made publicly available from 1st may 2006 at http : //terapix.iap.fr and http : //cencosw.oamp.fr/ .