FAS Computer Services to Harvard University IT: (617) 495-7777.
The Hypertext Preprocessor PHP is a server-side
scripting language. PHP code is usuallly embedded into HTML. PHP can be used on
the webpages of the Mathematics department. (The latest installed version is
Php-4.4.7). The open source software PHP4 does the same as the commercial
and proprietary products Microsofts Active Server Pages (ASP), Allair's ColdFusion and Sun's
Java Server Pages. The benchmark results are comparable or better, the
possibility to inspect the source code improves security. PHP is now the
most popular Apache module (Nov 1999: 1 Mio Hosts, Oct 2000, 3.8 Mio Hosts,
Aug 2005, 20 Mio Hosts (source)).
To see how PHP is used, consider count.php.
PHP can replace CGI programs because it can write to files or execute server commands.
The today date at the bottom of this page for example is obtained by executing the command
"date" on the server. The HTML contained just the line
date.php (source date.txt),
Note: The use of server-side scripting languages make sense if the
website depends on a large database which changes frequently. Whenever possible,
it is preferable to use static websites or to delegate the work to the client.
count.html.txt ), does exactly the same as
count.txt, but transfers only a 80 Bytes size file to the
client, who then builds the 4K page. In the PHP version, the server computed the
4K HTML file and transfered it.