mind you ive been up all night so if this seems choppy i apologize...
Overview:
What we are going to do is set up a webserver, that, will run php, mysql, perl and cgi scripts.
First and foremost you want the webserver, the one i used and that i recommend is Apache HTTP Web Server
www.apache.org - I downloaded the win32 MSI package
When you goto install the server youll be asked for some info
Network Domain:
Server Name: l
Admin Email:
Enter as follows:
localhost
127.0.0.1
your e-mail address
Once installed, open the Apache Monitor and make sure its running
(run it as a service during install)
goto start->Apache HTTP Server-> Configure Apache Web Server->Edit Configuration File
this opens notepad and your config file
Find DocumentRoot and enter in the dir that you will be keeping your files in
like this E:/dir (use the backlash)
scroll down and Find <Directory =
and enter in the same dir that you used for your DocumentRoot
put an index.html page in that directory
goto Apache Monitor and restart
test it by going to http://localhost or http://127.0.0.1 in your web-browser
if you see your index page good its working
-------now to install CGI/PERL-----------
Get ActivePERL from www.activestate.com
Install ActivePERL to a directory named e:\usr (it dont HAVE to be that name but its recommended)
have the "add Perl to the PATH environment variable" checked
and "Create Perl file extension association" checked
open your Apache Config File like above
Find Options Indexes FollowSymLinks
add ExecCGI to the end of it
so it looks like Options Indexes FollowSymLinks ExecCGI
Next, Find ScriptAlias /cgi-bin/ "E:/Apache2/cgi-bin/"
hash it out by adding a # in front of that line
Next, Find #AddHandler cgi-script .cgi
Remove the hash and .pl to the end
like this : AddHandler cgi-script .cgi .pl
Test CGI/PERL: open a new notepad document and paste in
#!e:/usr/bin/perl
print "Content-type:text/html\n\n";
print "hello world";
where the top line is where perl.exe is installed
save as either test.cgi or test.pl
put into your DocumentRoot Directory
goto Apache Monitor and restart
goto http://127.0.0.1/test.cgi or http://localhost/test.pl
whichever you named the filetype
If you see the words Hello world, good its working
--------installing PHP------------------
goto www.php.net and get the zipped version of PHP that is Win32/Apache compliant
unzip and goto the directory you unzipped it to and rename php.ini-dist it to php.ini
open php.ini
Find doc_root = "e:\public_html" and change it to whatever your DocumentRoot is
Find extension_dir = "./"
change it to the ext folder that unzipped with php
kinda like E:/php/ext
Now open you Apache Config File again and paste
LoadModule php5_module "e:/php/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "e:/php"
in the beginning or end of the config file, make sure to change the paths to the relevant ones where you unzipped php
save and goto Apache Monitor and reset
open up a new notepad put in
<?php
phpinfo();
?>
save as test.php in your DocumentRoot
goto it in your webbrowser
if you see a bunch of stuff, its working
---------Installing MySQL --------
goto http://dev.mysql.com/downloads/mysql/4.1.html and download the version for Windows
install the MSI and choose these
Typical Setup
Skip Sign-Up
make sure "Configure the MySQL Server now" is checked
Detailed Configuration"
Developer Machine"
Multifunctional Database"
InnoDB Tablespace Settings" - leave the same
Decision Support (DSS)/OLAP"
make sure "Enable TCP/IP Networking" is checked and leave the port number at 3306
Standard Character Set
check "Install As Windows Service"
"Include Bin Directory in Windows PATH" checked
enter root password
dont let remote access
hit "execute" and it'll install and set up.
Copy the libmysql.dll from your php directory to your system folder(usually system or system32)
open your php.ini file
Find ;extension=php_mysql.dll and remove the semi-colon
goto Apache Monitor and restart
to test yor MySQL by php
make a new notepad file and paste
<?php
// hostname or ip of server (for local testing, localhost should work)
$dbServer='localhost';
// username and password to log onto db server (what you entered in Step 4)
$dbUser='root';
$dbPass='';
// name of database (what you created in step 4)
$dbName='test';
$link = mysql_connect("$dbServer", "$dbUser", "$dbPass") or die("Could not connect");
print "Connected successfully<br>";
mysql_select_db("$dbName") or die("Could not select database");
print "Database selected successfully<br>";
// close connection
mysql_close($link);
?>
save it as sqltest.php in yor documentroot folder
load it in your browser if you see it you know its working
later on when ive had some rest ill tell you how to set phpMyAdmin so you can better have control over your MySQL databases
![Wink ;)](./images/smilies/icon_wink.gif)
zzzzzzzzzzzzzzzzz