Using nonlinear optical microscopy, single-phase (perovskite) and double-phase (perovskite+pyrochlore) thin films of lead zirconate titanate deposited on Pt/TiO2/SiO2/Si substrates by the method of high-frequency magnetron sputtering at different distances of the substrate targets (D=30-70 mm) were studied. An inhomogeneous distribution of the second harmonic signal in spherulite perovskite islands was detected, including an increase in the signal at the perovskite/pyrochlore boundary, which may be due to an inhomogeneous distribution of mechanical stresses. The reasons for strong changes in the signal of the second harmonic, its relationship to changes in the character of the spherulite structure and conditions of film deposition when the distance of the target-substrate varies are discussed.