That was certainly part of the convenience out of the box. But you could have done something similar with mod_perl since it had filters that could act on every page. Then embperl started to gain popularity some time in 1996, which was decidedly even more like a templating engine, and after that came Mason.
PHP really exploded in popularity when web hosting took off. It had a safe mode that made it possible to for several customers to co-exist in the same web server, without having the ability to read each other's files.