MediaWiki Installation on Windows Server 2003 (WAMP) – Part 3 – PHP 5

Articles in the Series

We are now up to installing PHP. Here is how I installed it using the zip file

  1. Download the latest version of PHP from here. I just get the Zip package of the windows binaries
  2. Create a directory called PHP on the C:\. In this guide I’m going to put it at “C:\PHP”.
  3. Extract all of the contents of the zip file into the PHP directory.
  4. Make a copy of the “php.ini-recommended” file and name it “php.ini”. I tend to leave the file in the C:\PHP directory even though some documentation says to put it elsewhere.
  5. Open the “php.ini” file and look for “doc_root”. Set it to “C:\Program Files\Apache Software Foundation\Apache2.2\htdocs” (Including Quotes). This directory is where the apache files are served from.
  6. In the same file look for “extension_dir”. And set it to “C:\php\etc”. What we are doing here is telling php where the extension dll’s are stored.
  7. In the same file look for a line that says “;extension=php_mysql.dll” and remove the ; from the start. This will tell php to use the MySql extension.
  8. Save the File.
  9. In the “C:\PHP\” there is a file called “libmysql.dll”. Copy it to “C:\Windows\System32”. This is so that PHP can communicate with the MySql server! It essentially puts the dll into a search path and php will use the extension to talk to this dll (I think!)… thus allowing php to communicate with MySql
  10. Go to the “htdocs” folder in the apache install: “C:\Program Files\Apache Software Foundation\Apache2.2\htdocs”
  11. Create a file called “info.php”
  12. Type “<?php phpinfo(); ?>” into the file and save (don’t include the quotes)
  13. Open your Browser and type http://localhost:8080/info.php We are not there yet of course. You should see the text you have typed in the file. We now need to tell Apache to pass .php files to the php processor. To do that navigate to the “conf” folder in the Apache installation -> “C:\Program Files\Apache Software Foundation\Apache2.2\conf”
  14. Open the “httpd.conf” file
  15. Add the following to the file and save it (This essentially tells Apache to let php process the file contents before sending it to the clients browser. PHP will then do it’s processing on the file, pass it back to Apache which will then send the processed file to the browser/user agent.)
# PHP 5 Settings
Loadfile "C:\php\php5ts.dll"
LoadModule php5_module "C:\php\php5apache2_2.dll"
PHPIniDir "C:\php"
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
  1. Restart Apache using the tool in the notification area.
  2. Browse to http://localhost:8080/info.php. instead of the php code you should see a page with a lot of php information on it.
  3. Search the page for the words “MySql”. If it is present then you are set to go!

Now to install MediaWiki!

1. Download the latest version of PHP from here. I just get the Zip package of the windows binaries

2. Create a directory called PHP on the C:\. In this guide I’m going to put it at “C:\PHP”.

3. Extract all of the contents of the zip file into the PHP directory.

4. Make a copy of the “php.ini-recommended” file and name it “php.ini”. I tend to leave the file in the C:\PHP directory even though some documentation says to put it elsewhere.

5. Open the “php.ini” file and look for “doc_root”. Set it to “C:\Program Files\Apache Software Foundation\Apache2.2\htdocs” (Including Quotes). This directory is where the apache files are served from.

6. In the same file look for “extension_dir”. And set it to “C:\php\etc”. What we are doing here is telling php where the extension dll’s are stored.

7. In the same file look for a line that says “;extension=php_mysql.dll” and remove the ; from the start. This will tell php to use the MySql extension.

8. Save the File.

9. In the “C:\PHP\” there is a file called “libmysql.dll”. Copy it to “C:\Windows\System32”. This is so that PHP can communicate with the MySql server! It essentially puts the dll into a search path and php will use the extension to talk to this dll (I think!)… thus allowing php to communicate with MySql

10. Go to the htdocs folder in the apache install: “C:\Program Files\Apache Software Foundation\Apache2.2\htdocs”

11. Create a file called “info.php”

12. Type “<?php phpinfo(); ?>” into the file and save (don’t include the quotes)

13. Open your Browser and type http://localhost:8080/info.php We are not there yet of course. You should see the text you have typed in the file. We now need to tell Apache to pass .php files to the php processor. To do that navigate to the “conf” folder in the Apache installation -> “C:\Program Files\Apache Software Foundation\Apache2.2\conf”

14. Open the “httpd.conf” file

15. Add the following to the file (This essentially tells Apache to let php process the file contents before sending it to the clients browser. PHP will then do it’s processing on the file, pass it back to Apache which will then send the processed file to the browser/user agent.)

# PHP 5 Settings

Loadfile “C:\php\php5ts.dll”

LoadModule php5_module “C:\php\php5apache2_2.dll”

PHPIniDir “C:\php”

AddHandler application/x-httpd-php .php

AddHandler application/x-httpd-php-source .phps

16. Save the file

17. Restart Apache using the tool in the notification area.

18. Browse to http://localhost:8080/info.php. instead of the php code you should see a page with a lot of php information on it.

19. Search the page for the words “MySql”. If it is present then you are set to go!

Advertisements

4 Responses to “MediaWiki Installation on Windows Server 2003 (WAMP) – Part 3 – PHP 5”

  1. MediaWiki Installation on Windows Server 2003 (WAMP) – Part 1 – Apache « What to call it? Says:

    […] MediaWiki Installation on Windows Server 2003 (WAMP) – Part 3 – PHP 5 […]

  2. MediaWiki Installation on Windows Server 2003 (WAMP) – Part 2 – MySql « What to call it? Says:

    […] MediaWiki Installation on Windows Server 2003 (WAMP) – Part 3 – PHP 5 […]

  3. MediaWiki Installation on Windows Server 2003 (WAMP) – Part 4 – MediaWiki « What to call it? Says:

    […] MediaWiki Installation on Windows Server 2003 (WAMP) – Part 3 – PHP 5 […]

  4. Installing SugarCRM « What to call it? Says:

    […] MediaWiki Installation on Windows Server 2003 (WAMP) – Part 3 – PHP 5 […]


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: