4. Given $\frac{x}{x^{2}+x+1}=\frac{1}{8}(0<x<1)$. Then the value of $\sqrt{x}-\frac{1}{\sqrt{x}}$ is ( ).
(A) $-\sqrt{7}$
(B) $\sqrt{7}$
(C) $-\sqrt{5}$
(D) $\sqrt{5}$
4.C.

Obviously, $x \neq 0$. Thus, $\frac{x^{2}+x+1}{x}=8$, which means $x+\frac{1}{x}=7$.
Since $\left(\sqrt{x}-\frac{1}{\sqrt{x}}\right)^{2}=x+\frac{1}{x}-2=5$, therefore, $\sqrt{x}-\frac{1}{\sqrt{x}}= \pm \sqrt{5}$.
Also, $0<x<1$, so $\sqrt{x}-\frac{1}{\sqrt{x}}=-\sqrt{5}$.