In the FAQ section of the PHP manual, I came across this:
Since Javascript is (usually) a client-side technology, and PHP is (usually) a server-side technology...
I understand what they mean about Javascript, but in what other contexts can PHP be used?
There are three main areas where PHP scripts are used.
-
Server-side scripting. This is the most traditional and main target
field for PHP. You need three things to make this work. The PHP
parser (CGI or server module), a web server and a web browser. You
need to run the web server, with a connected PHP installation. You
can access the PHP program output with a web browser, viewing the
PHP page through the server. All these can run on your home machine
if you are just experimenting with PHP programming. See the
installation instructions section for more information.
-
Command line scripting. You can make a PHP script to run it without
any server or browser. You only need the PHP parser to use it this
way. This type of usage is ideal for scripts regularly executed
using cron (on *nix or Linux) or Task Scheduler (on Windows). These
scripts can also be used for simple text processing tasks. See the
section about Command line usage of PHP for more information.
-
Writing desktop applications. PHP is probably not the very best
language to create a desktop application with a graphical user
interface, but if you know PHP very well, and would like to use some
advanced PHP features in your client-side applications you can also
use PHP-GTK to write such programs. You also have the ability to
write cross-platform applications this way. PHP-GTK is an extension
to PHP, not available in the main distribution.
Source -http://www.php.net/manual/en/intro-whatcando.php
I've used it before with http://www.bambalam.se/bamcompile/ to create standalone .exe's.
For tossing something quick together without any libraries, and just a single .exe, it's absolutely awesome. It doesn't support PHP 5 which is kind of a drag, but cool regardless.