This paper is concerned with the synchronization problem of optical chaos in vertical-cavity surface-emitting lasers (VCSELs). A proportional-integral (PI) controller is proposed to achieve the synchronization. An evolutionary programming (EP) algorithm is newly introduced for deriving optimal or near optimal PI control gains, such that a specified performance index between the master and slave VCSELs is minimized. A numerical result exemplifies the synchronization procedure.