We investigate a unique type of zero-index medium with both gain and loss (ZIMGL), whose effective permittivity and permeability are both purely imaginary but of opposite signs. We analytically show that, by using a slab of ZIMGL with equal magnitude of loss and gain, simulation realization of a coherent perfect absorber (CPA) and laser, i.e., the so-called CPA laser, can be achieved. Previously the CPA laser was proposed in parity-time (P T ) symmetric systems. However, the ZIMGL does not possess the P T symmetry and thus the underlying physics is distinctly different. By designing a photonic crystal (PC) composed of core-shell rods, with loss and gain distributed in either the core or the shell, we have realized such a ZIMGL. The CPA-laser functionality of such a PC is also confirmed in our numerical simulations. Our work provides a different approach for simultaneous realization of CPA and laser besides P T -symmetric systems.