In a book I'm reading, the author says "Most dynamic Web pages on the Internet are created with CGI and scripting languages". This isn't true anymore, is it? Aren't other technologies like PHP or ASP more widely used than CGI nowadays? I'm not sure how to find out stats for something like this. Thanks...
How old is the book?
CGI is old and hasn't been encourage for some time. There is probably a surprising amount of it hidden away. Some sites use URL rewriting to avoid breaking old links so you may see a lot of .cgi links which are in fact other technologies.
I would have thought that PHP far outweighs CGI nowadays. This will be mainly due to the majority of free/cheap hosts supporting PHP, PHP's relatively low barrier to entry for novice users, and that Wordpress is so popular as a blogging platform.
CGI, as in directly running an executable and sending its output to the browser, is dead. However, the CGI protocol lives on in more modern techniques such as FastCGI. FastCGI is used all over the place, for many different types of languages -- for example, PHP has a FastCGI mode which it uses to interact with the HTTP daemon.
Ditto for the use of scripting languages. There are probably some old script-based pages lurking around, but most websites have moved on to "real" languages such as Python, Ruby, C#, or Java.
CGI is just a standardized way for a webserver to talk to a program.
Even if your scripts aren't running through PHP, the CGI environment variables continue to exist. In PHP, you access these through the $_SERVER
array.
Additionally, PHP itself can run in CGI mode. In fact, with Apache, if you want PHP to run as the user that owns each PHP file, you need to run it via CGI or a similar mechanism (such as suphp).