Photonic beamforming by shifting the optical phase of one of the two local oscillators in a photomixing setup is a viable candidate for beamforming in terahertz frequency transmitters due to its seamless integration with terahertz generation by photomixing. Compared to the more common true time delay approach photonic beamforming is famous for, this concept has the advantage that the optical phase shifters are standard telecom components realizable in a photonic integrated circuit and do not need to scale with RF frequency. However, practical realization is problematic due to the disproportionate optical path length sensitivity of the optical phase and its susceptibility to thermal drift. In particular, the use of fiber-optic components is precluded without a means of phase control. While at microwave frequencies the phase difference between the antenna elements can be measured in the electrical domain and potential phase errors can be fed back to the optical phase shifter, this is not an option at terahertz frequencies. In this paper, a concept will be presented for measuring the phases of the antenna signals by optical homodyne detection, and using these measurements to control the optical phases appropriately.