We propose an active photonic phase drift cancellation scheme for frequency transfer over optical fiber based on a linear photonic RF phase shifter. The photonic RF phase shifter consists of a dual parallel Mach-Zehnder modulator and optical filter with the assistance of the local microwave signal. The phase drift induced by fiber transmission can be compensated by simply tuning the bias voltage of the modulator. The principle of the phase cancellation scheme based on the photonic phase shifter is demonstrated and validated experimentally by transferring a 0.5GHz reference signal over a 20km single-mode fiber with a root mean square jitter of less than 0.5ps.