The weak power substitution property for rings of matrices over the ring of functions on a compact metric space X is given in terms of cohomological dimension. A compactum with the ring of complex functions C(X) having the following property is constructed: the units of C(X) are not dense in C(X) and they are dense among squares.