Windows users will use php.ini much more than non-Windows users, as
functionality and configuration on the non-Windows side is usually handled
during the build process. Since the php.ini file is the master
configuration file for PHP, however, it includes both Windows and
non-Windows directives. An overall difference (or similarity) is the
pathnames convention. On Windows systems, one is used to writing paths like
While on non-Windows systems, forward slashes are used: /usr/local/bin/
and so on. You can get away with using any of the three path types; even
/Windows/somedirectory/ will work on Windows. If no drive letter is
specified, the current drive is assumed.
Following are other things to recognize and deal with when it comes to
- error_log is commented out by default, but if uncommented, will log
errors to a file. On Windows NT, this file is the Windows NT Event Log.
- extension_dir tells PHP where to look for loadable extensions (DLLs).
You can use "." or "./" or the explicit directory name such as "/php4/".
Whatever you use, be sure that extensions are actually present, or PHP will
choke and die if it expects to find extensions, then fails to do so. I'll
discuss extensions at greater length in the next section.
- session.save_path is quite important when you're using sessions, as
it's the directory in which session data is stored. The default entry
(/tmp) is not a directory usually found on Windows, so be sure you change
it at installation time, to the Windows equivalent: /Windows/temp
And then there're SMTP and sendmail_from. The mail() function in PHP is
a simple, quick and painless way to send mail. It does, however, require
one important component: an outgoing mail server. On Windows, you can leave
sendmail_path commented out, but you'll need to add values to SMTP and
sendmail_from. For example:
SMTP = host.yourcompany.com
sendmail_from = firstname.lastname@example.org
Alternatively, you can use "localhost" as the entry for SMTP, but you
must have some sort of outgoing mail server on your machine. The standard
Windows internal mail server is very slow and may not work at all.
Therefore, the recommended practice is to enter your network's outgoing
mail server name for SMTP. For example, if you are in an office environment
and your outgoing mail server is mail.yourcompany.com, use that. Or use
your ISP, such as mail.earthlink.net.
TIP: If these values are not set properly, you'll know it when you
attempt to use the mail() function. Your script will return an error such
as "Failed to connect."
Next, take a look at adding functionality to your installation, using