To avoid the unpredictable phase deviations of the spaceborne phased array (SPA), this paper considers the over-the-air (OTA) phase calibration of the SPA for the low earth orbit (LEO) satellite communications, where the phase deviations of the SPA and the unknown channel are jointly estimated with multiple transmissions of the pilots. Moreover, the Cramer Rao Bound (CRB) is derived, and the optimization of beam patterns is also presented to lower the root mean squared error (RMSE) of the OTA calibration. The simulation results verify the effectiveness of the proposed OTA phase calibration algorithm as the RMSEs of the phase estimates closely approach the corresponding CRB, and the beam pattern optimization scheme is also validated for more than 4dB gain of SNR over the randomly generated beam patterns.