The following was triggered by an earlier thread [webmasterworld.com]
I might have left one or two bugs?
Please review, comment and we hopefully will iron the last details
as is it works fine in XP, however I did not test it on any other platform.
I still did not install the last MS pack so I cannot report if the newest pack has any impact.
Installing a new web server: Apache2, PHP5, MySQL4 and PHPmyAdmin.
Download Apache 2 Windows Binary (MSI installer) [httpd.apache.org]
The zip must end with win32-x86-no_ssl.msi.
Download the PHP zip package and PECL modules [php.net] (PECL are extensions)
Although extensions should come in the PHP package found in the extracted Ext folder) The PHP zip is under "Windows Binaries".
Download the zip pack, not the installer.
Download MySQL [dev.mysql.com]
Look for: "Windows Downloads": MySQL Windows x86.
In case you are already running any flavor of PHP and MySQL start by stopping them.
We use the installer so it will come easy, just go with the flow!
But for "Install to a different folder", we will use/create:
C:\Program Files\Apache Group\ this_will_be Apache2
(Created by extracting files)
Go to [localhost...] It should show the default Apache index page in English.
In case of problem: Go to Start > All Programs > Apache and try to stop and start or restart (The "Monitor Apache Servers" utility may also appear in your Windows Taskbar System Tray by the clock, etc.).
Next edit the httpd.conf file using your favorite script editor.
"C:\Program files\Apache group\Apache2\conf\httpd.conf"
Go to line 228, and change the docroot to:
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
Go to line 253 and copy/paste the same dir as 228 but keep the “ <Directory “ first part
Save, and restart apache 2.
Unzip the PHP zip to C:/PHP (Create the Dir PHP at C:/ root level) Next: Shut down Apache;
Crank up your favorite editor again and open the apache httpd.conf and add two lines of code:
LoadModule php5_module C:/php/php5apache2.dll
AddType application/x-httpd-php .php
<edit> Added .php extension to show how to parse .php files</edit>
I have added those two to the very bottom of the httpd.conf file.
<edit>Note: See Message 11 below on where to put the LoadModule directive!</edit>
Verify that the path in the LoadModule directive points to the dir where PHP is installed.
Next, copy/paste "php.ini-dist" to C:/Program Files/Apache Group/Apache2, and rename it to php.ini.
In order to get a working WAMP we need to copy from C:/PHP root and from C:/PHP/ext some DLLs to Apache2 root (Where you did paste your renamed copy of php.ini) those are:
We need to set the PHP path for Windows:
Control Panel > System > Advanced tab
Click on "Environment variables"
Look in the "System variables" pane
Find the "Path" entry
Double click it and add at the end of the string your PHP dir
You need to start with ";" without double quotes!
And follow by: C:\php
So it will look like: ";C:\php" Again, without double quotes!
Now restart the Apache server.
Test: Create a simple file such as php5_info.php
Save it in C:/Program Files/Apache Group/Apache2/htdocs/php5_info.php
Open a browser and enter the following address [localhost...] it should display your complete PHP setting if it does not work properly you might have done something wrong with the multiple edits; check them out and give it another go.
Open up C:/Program Files/Apache Group/Apache2/php.ini. First, stop Apache
On line 276, you may change:
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
error_reporting = E_ALL
Which should be fine as a test server, remember this is a test server running under Windows as such it HAS NEVER BEEN INTENDED TO BE USED AS A PRODUCTION SERVER!
You may also change line 288:
display_startup_errors = Off
display_startup_errors = On
On line 351, you may possibly uncomment
";arg_separator.output = "&"
On line 378...
register_long_arrays = On
register_long_arrays = Off
After saving restart Apache. Run again your php5_info.php script and check that your changes are showing up as intended
Next: Let’s play with Extensions, there are a bunch of extensions that you will on your own explore however setting the SQL extension is a must!
Now, open your php.ini. On line 447 you should read: user_dir ="c:\php\" and below leave extension_dir = "./" as is.
Go to line 579 and uncomment:
Save and give it a try
If it does not work try:
extension_dir = "C:\PHP\ext"[fixed]
Save and try again!
As I mentioned all the DLLs should be in PHP dir or in the [fixed]PHP/ext dir.
If some are missing then unzip the PECL libraries zip file and pick your choices :)
Go to line 880 and enter
session.save_path = "C:\Program Files\Apache Group\Apache2\htdocs\tmp"
Do not forget to create the \tmp dir.
From then you should have a working PHP
Easy enough you may extract it in any dir that fits you. And run the setup.exe
Enjoy the show and follow the guide. (Chose to install at Apache Group root level)
Finished ...MySQL is installed
You may or may not configure the root user (remember this is your test bed not a production server)
if you decide not to set a root user then do not use a password in your connection functions.
Create a shortcut to start MySQL: Go to Apache Group root and open the bin dir highlight mysqld.exe and create a shortcut – this will start MySQL,
do the same with MySQLshutdown and drag those shortcuts to your desktop
From then you may run a simple query test or wait and use the PHPmyAdmin as a final test
Extract the zip file to .... /apache group/apache2/htdocs
The PHPmyAdmin dir has a long name so we prefer renaming it as "pma"
Then go to pma/config.inc.php
On line 39, type:
$cfg['PmaAbsoluteUri'] = 'http://localhost/pma/';
Go to line 84 and enter your password (again only if you set one!)
Verify that MySQL and Apache are running and go to [localhost...]
That is it -
You have installed the finest WAMP based on the most recent distribution and PHP5!
Remember that all scripts used in your web dev test bed are loaded in the Apache2/htdocs directory.
[edited by: coopster at 6:46 pm (utc) on Oct. 30, 2004]