There's one good way to test your install (besides creating a boring
little "Hello World" script): use the phpinfo() function. Open a text
editor and type this:
<? phpinfo() ?>
That's all! Save this file as phpinfo.php, and put it in Apache's
document root (htdocs), then fire up your Web browser and go to "http://localhost/phpinfo.php" where
you should see a long page of variables and their values. The phpinfo()
function automatically produces this page, which shows you what sorts of
things are installed, your environment, your settings, and so on. A lot of
configuration options can be controlled by modifying the php.ini file,
which you'll learn about in the next section.
TIP: If you only see the literal PHP code, or Apache says "file not
found," nine times out of 10 you have one of the following problems:
- Your phpinfo.php file is really called phpinfo.php.txt and you just
can't see the hidden file extension.
- Your phpinfo.php file is not in the Apache document root.
- Your ScriptAlias and Action lines in httpd.conf don't match up, or PHP4
isn't installed in the place you think it is.
- Your AddType lines are incorrect.
In other words, you've probably made a silly little typo, which can be
easily fixed.
Otherwise, if your installation blows up in your face, check the PHP Manual or php-windows
mailing list archives. Chances are, someone's been through the same
problem (but I swear, it's usually one of the silly things listed above, so
triple check them before ripping your hair out).
next page»