We propose a scheme for realizing quantum phase gates for two atoms trapped in separate cavities connected by an optical fiber. In the scheme, the atoms, cavities, and fiber mode are in resonance. In contrast to the original scheme [A. Serafini, S. Mancini, and S. Bose, Phys. Rev. Lett. 96, 010503 (2006)], the gates are performed within the null- and single-excitation subspaces in virtue of the asymmetric encoding for two atomic qubits and can function beyond the limit that the atom-cavity coupling is much smaller than the cavity-fiber coupling. We study the stability of the gates and the influences of dissipation and show that such gates are robust.