We consider the stochastic linear quadratic optimal control problem for state equations of the Itô-Skorokhod type, where the dynamics are driven by strongly continuous semigroup. We provide a numerical framework for solving the control problem using a polynomial chaos expansion approach in white noise setting. After applying polynomial chaos expansion to the state equation, we obtain a system of infinitely many deterministic partial differential equations in terms of the coefficients of the state and the control variables. We set up a control problem for each equation, which results in a set of deterministic linear quadratic regulator problems. Solving these control problems, we find optimal coefficients for the state and the control. We prove the optimality of the solution expressed in terms of the expansion of these coefficients compared to a direct approach. Moreover, we apply our result to a fully stochastic problem, in which the state, control and observation operators can be random, and we also consider an extension to state equations with memory noise.