Let's start with a fresh install of Apache on your system. If you have a
working version of Apache on your Windows machine, you can skip this
section -- there's nothing you need to do to Apache in preparation for PHP;
any modifications you'll make, you'll make after PHP is installed.
- Go to http://www.apache.org/dist
/binaries/win32/
and download the latest version of the Windows binary file. This file is
pre-compiled and ready to install.
- Once you have the file on your hard drive, run the executable file by
double-clicking it or typing its location in the Run dialog box under the
Start menu.
- The installation wizard will start. Read and accept all the licencing
stuff.
- The installation wizard will ask for the Apache installation directory.
The default is "C:\Program Files\Apache Group\Apache" but you can change
this to "C:\Apache\" or anything else you wish (just remember where it is
for later).
- The installation wizard will ask for the name that will appear in the
Start menu. The default is "Apache Web Server".
- The installation wizard will ask for the installation type: typical,
minimum or custom. The "typical" install is, well, typical, so go ahead and
choose that one.
Now you get to sit back and watch as the installation sequence runs
through its paces. The installation wizard will tell you when it's
finished, and then it will ask if you want to read the README file. Take a
quick look at it and click Finish to end the process.
During the installation process, a default set of configuration files
will be placed in the "conf" directory, which lives within the installation
directory (i.e. "C:\Program Files\Apache Group\Apache\conf\"). If you make
a few minor changes to the httpd.conf file (the master Apache configuration
file), you can start Apache and prove that it's working properly.
In your text editor of choice, open httpd.conf and find a line starting
with:
ServerAdmin
Modify this entry and provide your own information, such as:
ServerAdmin joe@schmo.com
Next, find a line starting with:
#ServerName
Take away the "#" and change this entry to real values, such as:
ServerName localhost
If you have a real machine name, like mybox.yourdomain.com, go ahead and
use it instead of localhost:
ServerName mybox.yourdomain.com
With those changes made, save the file and follow along to try to start
Apache. If you're on Windows NT and you want to run Apache as a service:
- Select "Install Apache as Service (NT only)" from your Start menu.
- Start the service named "Apache" by opening the Services window in the
Control Panel, selecting "Apache," and clicking the "Start" button.
Apache will now continue to run in the background, and will
automatically start whenever your machine starts.
If you're not running NT and need to start Apache on your own:
- Select "Start Apache" or "Start Apache as a Console App" from the
Apache folder in the Start menu. A console window will open and Apache will
run. Keep this window open.
And that's it. Really.
TIP: If you start Apache from the shortcut, and you see the window
flash and then disappear, something has gone awry. Nine times out of 10,
this means you have a typo in your httpd.conf. To keep the window open and
see the actual error message, open a DOS console, navigate to the Apache
installation directory, go into the bin directory and type apache.exe to
start the server. The window will stay open, you'll see the message, and
you'll know what to fix. Fix it, save httpd.conf, restart Apache.
You should never have to reboot your machine to start and stop
Apache. If you do, that's a Windows issue.
After starting Apache, open your Web browser and type
"http://localhost/" in the location bar to view the default installation
page and verify that it's working. If you used a ServerName other than
localhost, type that name in the location bar instead.
If your installation fails at any point, visit the Apache website and read the FAQ and
documentation in an attempt to pinpoint your problem. If Apache started
without a hitch, you're ready to install PHP.
next page»