Page 1 of 1
new to php
Posted: Tue Jul 23, 2002 5:06 pm
by gic
what's the easiest way I can make
my browser understand php offline?
// in windows98
Posted: Tue Jul 23, 2002 5:18 pm
by cctrax
lol...here is a little something I wrote for my website...
it may help ya out a bit

Installing an Apache Webserver on your Computer
Posted: Tue Jul 23, 2002 5:19 pm
by cctrax
This tutorial will explain in detail how to install an Apache web server on a Windows operating system. Apache is a great web server that will allow you to operate a small personal website for your family, or a huge lump of web pages for your business needs. It just so happens that Apache is the world's most popular web server, so naturally PHP was designed to work well with it.
I would always recomend you install the latest version of this webserver. You can always find it at http://www.apache.org/
Installing PHP
If you have not yet done so, you need to install PHP on your computer. As I would with any program, I would have to recomend that you download, and install the latest version of PHP. You can always find the latest version at http://www.php.net/
Once you have downloaded the current version of PHP, you will need to run the setup program to install PHP on your hard-drive. (I would expect you to choose the Standard installation method when installing) When you get the option of choosing where to download PHP to (what directory) please choose the default directory! Later you will have to tell Apache where to find PHP (c:/php/) and you need to make sure that PHP is where you say it is. To make it short, install PHP to the C:\PHP directory.
You are going to come to a screen that will ask you for the address to your SMTP server. If you do not know the name of this mail server you can leave set to localhost. In the next line, just type in the email address you want to be assigned on your outgoing email.
Here comes the tricky part. Select the type of server you want PHP to be configured with. If you plan on followed my tutorial here, and want to install an Apache Web Server, just click Apache. Easy as that.
Installing Apache
Installing the web server itself is the easy part. Apache uses the window installation program, and will install in less than 5 minutes. Just click on the setup file, and follow the directions on the screen (I would recommend choosing the Typical setup, unless you are familiar with this server and are just reading this for the fun of it).
Once you have installed the server, it would be best to install this web server as a "service." Basically meaning that you want Apache to be your default web server (on your computer) and Windows should always execute Apache when a web server is needed. Once installed as a service, Apache will start every time Windows stars, and will run in the background (meaning you will not see it, but it is working).
To install Apache Web Server as a service, simply click on Programs, Apache Web Server, Apache as a service, and install service under the start menu. Restart your computer. Simple enough huh?
Now to make sure that we are where we want to be, you will want to test Apache and make sure that it was installed correctly. Open up a web browser (such as internet explorer) and type in http:// followed by your IP address. (You can find your IP address by clicking start, Run, and typing in the command, "winipcfg".) In the strange event that you do not want to use your IP address, you can almost always use (127.0.0.1) If all worked out well, you should see a web page that states in large font up at the top "Seeing this instead of the website you expected?" Congratulations, you just installed a web server on your computer (but we are not done).
Configure Apache to run PHP
Now that you have a web server, you need to make sure that it will run your PHP scripts. There are just a few lines of text that you have to add to the configuration file.
Click start, programs, apache web server, management, and Edit Configuration. Scroll down to the bottom of the page, and type in these exact lines. (It is very important that you type these directories in correctly)
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php .phtml
Action application/x-httpd-php "/php/php.exe"
Just incase you wanted to know exactly what you just did, in the first line you created a virtual path that will allow Apache to get to PHP program files (ScriptAlias), entered the path you wanted your server to use, and the entered the "location" of the PHP files (program files) and place some nice quotation marks around them. In the next line, all you really did was tell Apache what file extensions to read as PHP file extensions (.php and .phtml). In that last line, you told Apache to run any file ending with .php or .phtml through the actual PHP Program you have installed on your computer. Tell this to your friends, and make yourself sound smart!
The Finial Test
One last thing before you leave me. Make sure that PHP was installed correctly, and create a new file (with notepad, ect) and just type:
<?php
phpinfo();
?>
You have to save this file in the Apache Group directory on your computer as test.php (I made a shortcut to it from my desktop, you may want to as well). Basically click on My Computer, Local Disk (C:), Program Files, Apache Group, Apache, and htdocs. (This is where all of your files will go)
Now just point your browser at http://127.0.0.1/test.php (or you may use your IP Address) and see what happens. You should get a page that displays information about your web server, and your current version of PHP.
© cctrax
All Rights Reserved
Hope it Helps!!!
hrm
Posted: Tue Jul 23, 2002 10:13 pm
by phice
The EASIEST and, to me, the BEST way of setting up something like this, would be PHPTriad.
Download... Then read the README for anything you need.
Posted: Tue Jul 23, 2002 10:17 pm
by cctrax
ewwwww...
sorry...I just have a thing for doing everything myself

Posted: Wed Jul 24, 2002 2:15 am
by twigletmac
EASIEST and BEST definitely depend on your experience and how much control you want or need when installing something. However, it's always nice to have options

.
Mac
Posted: Wed Jul 24, 2002 4:33 pm
by gic
thanks for the tutorial
i was able to install apache 2.039 and make it run with php
but i don't seem able to control it's behavior
the monitor does not work
if i install it as a service i can't shut it down not even from
the console
when i installed it so that it starts whenever i start the apache console
it started again doing like the above after some time
i just want it to be torned on whenever i want and shut
down whenever i want
any ideas
Re: hrm
Posted: Wed Jul 24, 2002 5:29 pm
by psn
phice wrote:The EASIEST and, to me, the BEST way of setting up something like this, would be PHPTriad.
Download... Then read the README for anything you need.
Espeacially with Windows as its not as easy to install all the programs.
I use it. You just sometimes have to get the apache server started and get mysql db started. mainly when just started computer.
Its a great program.
Re: hrm
Posted: Wed Jul 24, 2002 10:18 pm
by phice
psn wrote:phice wrote:The EASIEST and, to me, the BEST way of setting up something like this, would be PHPTriad.
Download... Then read the README for anything you need.
Espeacially with Windows as its not as easy to install all the programs.
I use it. You just sometimes have to get the apache server started and get mysql db started. mainly when just started computer.
Its a great program.
^_^
I can't wait to get my eMac, and start using MacOSX... I wanna see how easy that could be to install PHP/Apache/MySQL