Information here is valid for: Apache >= 2.0.55, PHP >= 4.4.1 < 5, MySQL 5.0.18, PHPMyAdmin 2.7.0-pl2, and maybe later versions (Windows).
Apache
- Go here: http://httpd.apache.org/download.cgi and download Apache binary installer for Windows. Filename is similar to this: apache_2.0.55-win32-x86-no_ssl.msi. Once it's done downloading, run the file.
-
You'll see something similar to: "Welcome to the Installation Wizard for Apache"... Blah blah blah.
Click next. -
"I accept the terms in the license agreement" Click next.
Next, again. -
Network Domain: localhost
Server Name: localhost
Administrator's Email Address: admin@localhost (unless you wanna put in your own email)
"For All Users, on Port 80, as a service -- Recommended.", click next. - Typical installation. Click next.
- Choose a place to install Apache, or leave it as is. Click next.
- Click install.
- Click finish.
- Unblock from firewalls, Apache and port 80.
You'll notice a new icon in the system tray. You can start, stop, or restart apache from there. Go to http://localhost/ and if you see the Apache test page, then congradulations—but we're not done yet.
Open up the file "httpd.conf", in a text editing program, found in the Apache directory, under the folder: "conf". Look for:
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
or something similar. Change it to:
DocumentRoot "C:/full/path/to/www/folder/".
Now, look for:
<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
or something similar. Change it to match your DocumentRoot. Restart Apache.
Apache Troubleshooting
After unblocking Apache, and port 80 from any firewalls you have, and http://localhost/ doesnt show the Apache Test page, then try these methods:
- Make sure no other program is using port 80 (this is usually the main reason).
- Disable the Windows firewall and get a better firewall, and unblock Apache and port 80 from there.
- Edit the Apache httpd.conf file, found in the Apache folder, in the conf folder, and change "localhost:80" to "localhost:8080". Then test out "localhost:8080" in the browser: http://localhost:8080/
If any of these methods dont work, then I forgot a specific method, or I cant help you any further and you'll have to seek help somewhere else. I will not respond to any emails relative to this problem.
PHP
- Go here: http://www.php.net/downloads.php and download the binary zipped file.
- Once it's done downloading, unzip to a folder, prefferably, in a new folder called: "PHP" under C:/.
- Make a copy of "php.ini-dist" and rename it to: "php.ini".
- Open that file for editing, in a text editor.
- Uncomment the "include_path", by removing the semicolon so that it's like this:
include_path = ".;C:\php\includes\"
- Change "doc_root" to match "DocumentRoot" from the Apache httpd.conf file.
- Modify "extension_dir" to point to your PHP extensions folder, probably, "C:\PHP\extensions" or "C:\PHP\ext".
- Save and close.
For Apache 2.0.*
- Copy "php4apache2.dll" from the "sapi" folder into the PHP directory. Also, make sure "php4ts.dll" is in the same directory.
- Open up "httpd.conf", again, from the Apache conf folder, for some more editing.
- Search for the section about "LoadModule" and add:
LoadModule php4_module "c:/php/php4apache2.dll"
For Apache 2.2.*
- Download the Apache 2.2.* Handler)
- Extract "php4apache2_2.dll" and "php4apache2_2.lib" from the zip file into the PHP directory. Also, make sure "php4ts.dll" is in the same directory.
- Open up "httpd.conf", again, from the Apache conf folder, for some more editing.
- Search for the section about "LoadModule" and add:
LoadModule php4_module "c:/php/php4apache2_2.dll"
- Now look for the section about "AddType" and add:
AddType application/x-httpd-php .php .php3 .php4 .phtml
If you want HTML files to translate PHP scripts, just add " .html" to the end of that line.
- Now, look for "DirectoryIndex", and add "index.php" so that it looks similar to this:
DirectoryIndex index.php index.html index.html.var
- Save, close, and restart Apache.
- Now make a new PHP document in the DocumentRoot folder, with the name "phpinfo.php".
- Edit and add:
<? phpinfo(); ?>
- Save and close.
- Now click here: http://localhost/phpinfo.php, if you see a page full of lots of PHP info, then you've successfully installed PHP. If you don't, then it could be you didn't, or you're using a different port. If so, add that port to the URI.
- Delete "phpinfo.php" after you know everything is working.
PHP Troubleshooting
Never really had a problem installing PHP, so, you're on your own with any problems you encounter.
MySQL
- Go here: http://dev.mysql.com/downloads/mysql/ and download the "Windows (x86)" one.
- After download finishes, run the file.
- "Welcome to the Setup Wizard for MySQL"... click next.
- "Typical", click next.
- Click install.
- After installation, "Skip Sign-up", and click next.
- Make sure "Configure the MySQL Server now" is checked, and click finish.
- Another window shows up, click next.
- "Standard Configuration", and click next.
- Make sure everything is checked, and click next.
- "Modify Security Settings", enter a password and make sure you remember it, and dont make it easy as well, leave everything else unchecked, and click next.
- Click execute. You may have to unblock anything that the firewall picks up.
- When it tells you to press finish, press it.
- Open up Command Prompt/MsDOS, and type in:
mysqlshow -u root -p
When it prompts you for password, enter the one you entered during the MySQL installation.
If you see something afterwards similar to something about Databases: "information_schema", "mysql", and "test", then good!
PHPMyAdmin
- Go here: http://www.phpmyadmin.net/ and download the latest release.
- After download is complete, extract the zip file into the "DocumentRoot" folder, and rename the folder to: "phpmyadmin".
- Make a copy of "config.default.php" and rename it to: "config.inc.php".
- Open "config.inc.php" for editing, in a text editor.
- Modify so whatever is here, matches:
$cfg['PmaAbsoluteUri'] = 'http://localhost/phpmyadmin/';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['auth_type'] = 'http';
- Save and close.
- Open up the "php.ini" file again, for more editing, in a text editor.
- Look for ";extension=php_mbstring.dll" and unquote it by removing the semicolon. If you dont see it, then add it.
- Save and close.
- Open up "httpd.conf" again for more editing, in a text editor. Look for something similar:
Alias /icons/ "C:/Program Files/Apache Group/Apache2/icons/"
<Directory "C:/Program Files/Apache Group/Apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
and under it add:
Alias /phpmyadmin/ "C:/phpmyadmin/"
<Directory "C:/phpmyadmin">
AllowOverride None
Order Deny,Allow
Allow from 127.0.0.1
</Directory>
- Replace all the ""C:/phpmyadmin/"" with the real path of the PHPMyAdmin directory.
- Restart Apache.
- Go here: http://localhost/phpmyadmin/, and when it prompts you, enter "root" as the username, and as for the password, use the one from the MySQL installation.
After a bit you should see the PHPMyAdmin page.
PHPMyAdmin Troubleshooting
If it keeps asking you for username and password, cancel it. You might see an error something like this:
Client does not support authentication protocol requested by server; consider upgrading MySQL client.
Easy to fix.
- Close the browser, and click on Start > Program Files > MySQL > MySQL Server: Command Line.
- Log in.
- Now type this:
SET PASSWORD FOR root@localhost = OLD_PASSWORD('password');
Replace "password" with the password used in the MySQL installation, and hit enter.
- Close, restart MySQL, and try logging into PHPMyAdmin again.
PHP 5
Make sure
PHPIniDir "C:/PHP"
is in the Apache "httpd.conf" file.
If these methods don't work, then I can't help you. You'll have to seek help elsewhere, for I will not respond to any e-mails relative to other problems.