Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Aug 2000
Posts: 3,590
Likes: 1
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Likes: 1

Manually installing the PHP package


Downloading PHP for Windows


You can find the binary of PHP at http://www.php.net/downloads.php
[direct link]. The file is 5.2 MB, and is distributed as a single zipped file.

Installing PHP


Extract the zip file to a directory of your choice. I put mine at H:php.
Some servers might crash if there's a space in the path name (i.e. H:My
3l33t PHP Installation
), so try to steer clear of that.

Copying required files


You'll need to copy the file php4ts.dll to your C:WINNTsystem32
folder (or C:Windowssystem32 for Windows XP). Also copy the file
php.ini-recommended to your C:WINNT folder (or C:Windows
for XP) and rename it to just plain ol' php.ini.

And now for more file copying


Due to some changes in the working of Apache 2.0.39, the standard PHP DLL file
for Apache2 will no longer function "out-of-box." This can be solved
easily, by downloading https://ubbdev.com/files/php4apache2.dll
[direct link]. Save
and copy that file to your H:phpsapi directory, overwriting any
existing file. Life is good--for the moment, at least.

Editing your php.ini


Open up your newly copied and renamed php.ini file. Search for extension_dir
=
and change it to read extension_dir = H:phpextensions
(making sure to modify it to reflect your actual path). Search for
doc_root = and change it to doc_root = H:httpdocs
where the path is the same as the one you picked for your HTML files back
in step one. Sounds easy enough, right?

We'll leave the rest of the file alone for now, but if you'd like to modify
more on your own, read up at http://www.php.net/manual/en/configuration.php.

Apache, meet PHP


We're going to run PHP as a module for Apache, instead of as a CGI binary,
because it's more transparent and secure. And you really care about that,
right? You're just waiting for me to get to the good stuff, so here we go.

Open up your httpd.conf file again (it's the last time, I promise)
and search for #LoadModule ssl_module modules/mod_ssl.so. Directly
underneath that line, add LoadModule php4_module H:/php/sapi/php4apache2.dll.

To try to keep all the "scripting stuff" in the same spot of my httpd.conf
file, I put the remaining lines necessary for PHP near the line we modified
in order to use Perl before. Search for AddHandler cgi-script .cgi .pl
and then add this block of code a line or two below that.
Code
#
# To use PHP scripts:
#
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps

The final section around that block should look like mine, which is below.
Code
#
AddHandler cgi-script .cgi .pl

#
# To use PHP scripts:
#
AddType application/x-httpd-php .php .php3 .phtml
AddType application/x-httpd-php-source .phps

#
# For files that include their own HTTP headers:

Restarting the server



After making the outlined changes to httpd.conf, save and close the
file. Then, double-click the Apache Service Monitor icon in the
tray to pop open--you guessed it--the Apache Service Monitor! Click the Restart
button and then wait a few seconds while Apache shuts down and starts back
up.

When the server comes back online, your screen should look like mine; also
take note of the text at the bottom of the window that reads Apache/2.0.39
(Win32) PHP/4.2.2-dev
. This just means that all is well in Apache land.

[Linked Image]

Your first PHP script


Copy 'n paste
Code
[/code]into a new file in <kbd>Notepad</kbd> and then save it as<em> H:httpdocsphpinfo.php</em>. To recap, the entire file should read [code]
Now browse to http://127.0.0.1/phpinfo.php and check to make sure
that what you see looks like my screen shot below.

[Linked Image]

If you can't see this screen, you hit a bump in the road somewhere along the
way. Your first move should be to visit http://www.php.net/manual/en/install.apache.php.
Start by reading the newest comments (the ones at the very bottom of the page)
to check if your problem has already been encountered by another user.

Enabling compressed output


Optionally, you can choose to compress PHP output using zlib compression.
This cuts down on your bandwidth and also helps pages to load faster. If you'd
like to turn zlib on, just follow the steps below.

According to the zlib Web site (http://www.gzip.org/zlib/), zlib is "a
free, general-purpose, legally unencumbered--that is, not covered by any patents--lossless
data-compression library for use on virtually any computer hardware and operating
system." So there you have it, straight from the horse's mouth. Let's
turn it on already, shall we?

In php.ini, search for zlib.output_compression = off
and change it to read zlib.output_compression = on. All you have
to do next is search for ;extension=php_zlib.dll and change the
line to read extension=php_zlib.dll. Browse to http://127.0.0.1/phpinfo.php
once more and then scroll down to the section about zlib. You should see what
I see.

[Linked Image]

Page 4: Installing MySQL as a service

Sponsored Links
Entire Thread
Subject Posted By Posted
Tutorial: Setting up your own Web server The Team 03/05/2002 1:08 AM
Re: Tutorial: Setting up your own Web server The Team 07/10/2002 5:46 PM
Re: Tutorial: Setting up your own Web server The Team 07/10/2002 5:48 PM
Re: Tutorial: Setting up your own Web server The Team 07/10/2002 6:16 PM
Re: Tutorial: Setting up your own Web server The Team 07/10/2002 6:20 PM
Re: Tutorial: Setting up your own Web server The Team 07/10/2002 6:21 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Zarzal
Zarzal
Berlin, Germany
Posts: 808
Joined: July 2001
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,824
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 1916
Topics Created 0
Posts Made 0
Users Online 1
Birthdays 17
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)