Tải bản đầy đủ (.pdf) (10 trang)

Tài liệu Beginning PHP4 P2 pptx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (259.5 KB, 10 trang )


13
Installing PHP4 on Windows 95 and 98
First of all, let's install Microsoft Personal Web Server (PWS). It should be noted PWS is really only suitable
for running your development machine on – it's not up to the job of running a real web site. However, it
provides a convenient and inexpensive development environment for pre-Windows 2000 machines, without
the need for powerful hardware. One of the main drawbacks of PWS is that it can be awkward to install and
get up and running correctly. Let's try and get over this by following these steps:
Obtaining PWS
The version of PWS you need to install is version 4.0, which was first released in NT 4 Option Pack of Dec
1997 as part of IIS 4.0. It is available from several sources, as follows.
Visual InterDev
Microsoft's Visual InterDev version 6.0 includes PWS. It can be installed at the time VID is set up or can be
installed afterwards as an option from a custom set-up.
Windows 98
The Windows 98 CD contains an installer for PWS. Most people who have installed PWS from the Windows 98 CD
onto a Windows 98 installation seem to have fewer problems then those who use other sources.
FrontPage
FrontPage, FrontPage 97 and FrontPage 98 included PWS, although in different flavors.

The early releases of FrontPage had a program named HTTPD which was sold as Front Page
Server. The functionality was the same as PWS, but it was an entirely different set of code. As far as
we are aware, it's not possible to run PHP under this server.

FrontPage 97 contained PWS 1.0, and FrontPage 98 contains PWS 4.0, the current incarnation of PWS.
Download
Microsoft offers PWS as a download, but with a strange nomenclature. It is actually a component of the
Windows NT option pack for Windows 95. If you run the Windows NT Option Pack on a Windows 9x
machine, the option pack will recognize that this is not an NT OS and will install PWS instead of IIS.

"Wait A Minute! Run the Windows NT Option Pack on Windows 9x?" Many people have a hard time


believing that one possible technique to install PWS was to run the NT Option Pack on their Windows 9x
machines. But it does work and is the recommended method for Windows 95 users. We'll show you how to do
it shortly.
Which Source To Use
You'll generally have the fewest problems when installing PWS on Windows 98 from the Windows 98 CD.
The second least-problematic source seems to be the NT download which is good for Windows 95 as well as
Windows 98. Another strategy with minimum complaints has been the installation from NT 4 Option pack
onto NT workstation. Folks that are installing from Visual InterDev and FrontPage CD-ROMs seem to have
the most problems. It is also recommended that if you are considering moving from Windows 95 to Windows

14
98, you do so before attempting to install PWS.
Installing From NT Option Pack Onto Windows 95
This is the best option for Windows 95. However, keep in mind that a much higher percentage of users have
had problems with PWS on Windows 95 then PWS on Windows 98. If you are considering upgrading to
Windows 98 we suggest you do it prior to installing PWS.

1.
Close all applications.
2.
Download Windows NT Option Pack for Windows 95 from
You'll find the
link at the bottom of the web page.
3.
Select option 1 of the download options, and then on the next page select the operating system you are
running on. On the next page click on download.exe for the site nearest to you.


4.
Save the program to disk.

5.
Go to the directory where you saved download.exe and run it, and the wizard will first ask you
to agree to the licensing terms, and then present you with the following screen:

15


6.
Choose to download only, as, if the install option quits halfway through, it can mess up your
machine's configuration.
7.
Click Next and choose x86: Windows 95 for the operating system and click Next.
8.
Choose the Typical Installation and click Next.
9.
Choose a location on your hard drive of where to download the pack to, and click Next.
10.
Choose a location from where to download the pack.
11.
Accept the verification certificate that appears and then the option pack will download.
12.
Finally go to the location where you saved it, and run the newly downloaded setup.exe.
Installing From The Windows 98 CD Onto Windows 98
This is the safest option for installing PWS, but is only possible if using Windows 98. The steps are as follows:

1.
Ensure that the Windows 98 CD is in the drive. When you insert the CD, a splash screen will
normally appear. Click the button marked Browse this CD.
2.
In the explorer window for your CD-ROM, you should find a directory called add-ons. Inside,

there will normally be a single directory called pws. Open this up.
3.
Run the program in this folder called setup.exe.
Setting Up PWS
Having downloaded or located PWS's setup tool and run it, you will be greeted with a splash screen similar to
the following:

16




For most users, the typical install will work fine. If you choose to do a custom install, then ensure that at least
the following components are selected:


Common Program Files

Personal Web Server



You will then be prompted for your default web publishing home directory. The normal one to choose is
C:\Inetpub\wwwroot, although you can choose anywhere. Later in this chapter, if we refer to

17
C:\Inetpub\wwwroot, you should remember to substitute it with the path we used here.





Installing PHP4 Alongside PWS
Now you've installed PWS, and your computer has rebooted, let's get PHP4 installed. First of all you need to
download it. While you would normally obtain the latest version of PHP4 from
unfortunately the version of PHP distributed via that site is only a basic installation, and doesn't support all the
features we need. Instead, we recommend you go to and download their latest, non-
development, stable release. You'll end up with a ZIP file, which you should save somewhere on your hard
drive. Create a folder for your PHP software to live in – somewhere like C:\php is good – and unzip the file
you downloaded into this directory.

Now, this directory contains several sub-directories, and a few text files. Also, a program file called
php.exe, which we won't actually be using, and a library file called php4ts.dll. To start off, you need to
copy this .dll to your C:\Windows\System directory. Now open up the dlls subdirectory, and copy all
of the files from here to your C:\Windows\System directory as well. If Windows complains that you've
already got a file by one or other of these names, then keep your old one – don't overwrite it with the newly
downloaded files.

Now, back in the top of our PHP directory, there should be a file called php.ini. Copy this file to C:\Windows,
and open it up with Notepad. Scroll down the document until you find a line that looks like:

extension_dir = C:\php\extensions ; directory in which the loadable extensions
(modules) reside

Now, make sure that this path is the correct path to the extensions directory of the unzipped PHP4
installation. If it isn't, change it to point to the right place. (The extensions directory is the one which

×