Updated 2013-12-18 01:32:11 by SEH

Stands for: PHP: Hypertext Preprocessor (DKF: but originally allegedly stood for Personal Home Page.)

PHP is a scripting language mainly designed for web development, where it is quite popular--arguably the single most widely-used server-side language.

(perhaps freely distributable language. ColdFusion and JSP are pretty popular, as well.)

This [1] is PHP's home page.

For Tcl's answer to PHP, see Rivet.

Or try THP for a webserver neutral way to embed Tcl code. --CAU

In the last few years, "PHP [has become] Handy off the Web, Too", although this article [2] doesn't recommend it for those who already know Tcl and similar languages.

In a remarkable newsgroup posting [3], [Derk Gwen] provides a recipe for the C implementation required to link in a Tcl library so PHP source can also interpret Tcl.

See a Tk binding for PHP at [4]

Incidentally, our own SS maintains an attractive "web-based interactive shell for PHP" he and his collaborator call "PHP Interactive" [5].

Sarnold 2006/01/08 -- This article [6] about PHP's use in Yahoo! shows Ousterhout's Dichotomy in application.

I remember an interview of a member of Yahoo!'s team advocating strongly in favor of this way to conceive Web programming, notably using some Template Engines written in pure PHP.

See also:


The following might be an example of PHP in HTML, which someone on 20 June 2005 posted over the previous contents of this page.
 <html>
 <head>
 <title>Counting from x to y</title>
 </head>
 <body bgcolor="white">

 <?php function print_sequence ($start, $stop, $increment) {
 if ($start > $stop) {
 return(FALSE);
 }
 elseif ($increment <= 0) {
 return(FALSE);
 }
 else {
 for ($i = $start; $i < $stop; $i = $i + $increment) {
 print "$i ";
 }
 }
 return(TRUE);
 }
 ?>

 <h1>Counting from x to y</h1>
 <p>
 Counting from 1 to 10 by 1: <?php print_sequence(1, 10, 1)?>
 </p>
 <p>
 Counting from 2 to 20 by 2: <?php print_sequence(2, 20, 2)?>
 </p>
 </body>
 </html>

Costs of Deploying PHP

(from the chat)

dkf If they do manage to force you on the PHP issue, insist on more money for supporting it

dkf Ideally, you need an extra body to work full-time on tracking down rogue versions of PHP apps and getting them to upgrade

...

dkf As I said, assess the cost to be at least one extra admin's worth of effort

dkf i.e. if there's only one of you, adding PHP will double admin costs

dkf other data points: the admin will have to be competent; keeping on top of the PHP mess is not an entry-level task

dkf and it's a very bad idea to deploy PHP in a visible position (outside the firewall) before you have that admin in place

Balinares speaks for most Tclers (although I think he's not one himself) in this explanation [7] of the cultural and technical liabilities of PHP. Also, see "Problems of PHP" [8].

More reasons to be glad you're using Tcl: [9], [10], [11]

See also PHP Wiki.