We establish the necessary and sufficient conditions of existence of nontrivial quasi-polynomial solutions of the problem in a layer for homogeneous partial differential equation with $s+1$ variables of second order in time variable and generally infinite order in other $s$ (spatial) variables with Dirichlet boundary conditions in time. We apply the differential-symbol method for constructing such quasi-polynomial solutions. We also give examples of problems for which we construct other solutions besides of quasi-polynomial ones.