PHP got traction because it was easier for hosting companies to set up shared PHP hosting and it was easier for non developers to add basic code to HTML pages. PHP was also at the right moment at the right time,just like MySQL and some people made it easy to install it on Windows, a platform too often ignored by language maintainers (try to write Ruby on windows, a (slow) pain in the ass).
Uh, the early versions of PHP was written in Perl running under mod_perl, which was not CGI.
Also, e.g. fastcgi was around the same time frame.
(In order not to end up in a flame war regarding the first point I checked wikipedia -- see second paragraph of the intro here. :-) https://en.wikipedia.org/wiki/Mod_perl )