Manual:Installing MediaWiki on Windows XP - MediaWiki 1.9.2
From MediaWiki.org
| The content of this page has not been verified. Instructions written in this page have not been verified to be correct. |
Contents |
[edit] About
This article is a refresh of an old one article Manual:Installing MediaWiki on Windows XP - MediaWiki 1.7.1 which is obsolete for MediaWiki 1.9.2.
If you are looking for installing with Apache instead of IIS, try this Manual:Streamlined_Windows_Install_Guide
[edit] Components
[edit] Server
- MediaWiki 1.9.2
- PHP 5.1+
- MySQL 5.+ (Last working is MySQL 5.0.24 - MySQL 5.0.26 doesn't work)
- Cygwin
- Windows XP
- HTTP/IIS 5.1
- SMTP/IIS 5.1
[edit] Supporting
- Notepad++ (for syntax highlight)
- Telnet (for SMTP)
- Explorer (for rights)
- IIS Console
- Internet Explorer 7.+
- WinMerge (for text file differences analysis)
[edit] Result
Working MediaWiki
[edit] Steps to Start MediaWiki on IIS
[edit] Create MediaWiki Virtual Directory on IIS
- Get a stable version of Mediawiki from [1] and extract it to any path, i.e. c:\mediawiki.
- Open IIS Console Start -> Control Panel -> Administrative Tools -> Computer Management -> Service and Applications -> Internet Information Services. If Internet Information Services can not be found, it may need to be installed using Add/Remove Windows Components.
- Create virtual directory i.e. in root directory with any name i.e. MediaWiki which points real directory to c:\mediawiki (open 'Web Sites' -> 'Default Web Site' -> properties -> 'New' -> 'Virtual Directory' then follow the wizard). If you have problems, look at [2]
- Grant the permissions Read & Execute for IIS console.
- Exit the console and go to the IIS file explorer(Start -> Control Panel -> Administrative Tools -> IIS file explorer). Grant access to IUSR_YOURMACHINENAME (your machine name is specific to your computer) by modifying directory permissions to C:\mediawiki\images from the IIS file explorer (if you plan to upload images).
[edit] Install PHP
- Information below is related to PHP 5.1.6 so it also apply to any PHP 5.+ and also some to MediaWiki 1.+
- Get PHP in form of *.zip from [3] and extract all files to any path i.e. c:\php (automatic installation php in form of *.exe is also possible but it is not perfect solution as it generates some unnecessary files in different directories and changes in configuration of IIS so it is not recommended).
- Open IIS Console Start -> Administrative Tools -> Internet Information Service or My Computer -> right click -> Manage Computer -> Service and Applications -> Internet Information Service.
- Open properties of Mediawiki virtual directory:
- Open Home Directory tab and next open Configuration and next open Mappings tab and add following pair: .php -> c:\php\php-cgi.exe. Look at [4] if you have problems seeing the OK button.
- Optionally you could use php_isapi.dll instead of php-cgi.exe for better performance by opening ISAPI filters tab and pointing to c:\php\php_isapi.dll (only on MediaWiki virtual directory - remember to NOT setup php_isapi.dll on root directory configuration if it is not needed - remove php_isapi.dll from root directory configuration if you did automatic PHP configuration on IIS before).
- After adding c:\php\php_isapi.dll to ISAPI filters remember to set the environment variable PHPRC=c:\php
- Open Documents tab and set the default document to index.php. Optionally, you could remove all other documents from the list to keep your site more secure.
- Open properties of Mediawiki virtual directory:
- Create c:\php\php.ini from c:\php\php.ini-recommended file for production server or optionally create from c:\php\php.ini-dist for development server (slower and insecure configuration for production servers)
- Make some changes in php.ini (enable MySQL extension, configure SMTP).
- The following options should be changed as shown below (based on php.ini created from php.ini-recommended).
- All sub-directories described below should be created if they are missing.
- A list of valid timezones is available here: [5].
extension_dir = "c:\php\ext" cgi.force_redirect = 0 cgi.rfc2616_headers = 1 file_uploads = On upload_tmp_dir = c:\php\uploadtemp extension=php_mysql.dll SMTP = localhost smtp_port = 25 sendmail_from = yourname@yourdomain.org # Keep DNS/DHCP requirements in mind. For example, # if setting up for internal network use with your own email server, # you might be able (or need) to address the server by name, e.g. SMTP = mail.yourdomain.org # or you might need (or be able) to use the server's IP address, e.g. SMTP = 192.168.1.555 # Don't forget to consider the fact that your properly configured email server prevents message relaying. # # You may also need to include one or both of # auth_username=YourUserName # auth_password=YourMailPassword session.save_handler = files session.save_path = "c:\php\sessiondata" date.timezone = Europe/Warsaw memory_limit = 32M ; <- Exporting of any pages could be problem with default 8M (see: Special:Export)
- The following options could be set also
upload_max_filesize = 2M /* <- depends on size you want to upload */
- Add paths PATH and PATHEXT system variables (if it not already added by php setup)
PATH=C:\PHP; ... (this allow to find dlls) PATHEXT: .PHP (this allow to execute from command line)
Right click on My Computer and click Properties. Click on Advanced. Click the Environment Variables button. Highlight the path variable in the Systems Variable section and click edit.
- grant IUSR_YOURMACHINENAME modify permissions to C:\PHP\uploadtemp (Create this directory if it doesn't exist)
- grant IUSR_YOURMACHINENAME modify permissions to C:\PHP\sessiondata (Create this directory if it doesn't exist)
- restart IIS using iisreset.exe from command line
start->run-> type in iisreset.exe
- Save your modified php.ini file. Now create a PHP script C:\Mediawiki\info.php containing the lines :
<?php phpinfo(); ?>
- Start Internet Explorer, and visit the address http://localhost/Mediawiki/info.php. If everything has been setup correctly you will get PHP welcome screen.
[edit] Install MySQL
- get latest package (latest working is MySQL 5.0.27 - MySQL 2.0.26 is not working and installation is not possible for MediaWiki 1.7.1 and 1.8.1) from [6]
- Use the setup file. Perform a full installation with defaults into any path i.e. C:\Program Files\MySQL.
- Add path to PATH
PATH=C:\Program Files\MySQL; ...
- Check if installation is working
open start->run->type in cmd.exe
C:\>mysqlshow.exe -u root -p Enter password: *********** +-----------+ | Databases | +-----------+ | mysql | | test | +-----------+
You may need to go to the c:\Program Files\MySQL\MySQL Server 5.0\bin directory to get this command to work.
[edit] Install Cygwin
Try to install some packages from cygwin [7] to c:\cygwin
- diff3 - for versions compare
- Peter Blasie says: WHY use CygWin? That are it's features and benefits, and how does it accomplish it's offering?
- From http://www.cygwin.com/ :
- What Is Cygwin?
- Cygwin is a Linux-like environment for Windows. It consists of two parts:
- A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality.
- A collection of tools which provide Linux look and feel.
- The Cygwin DLL currently works with all recent, commercially released x86 32 bit and 64 bit versions of Windows, with the exception of Windows CE.
- Note that the official support for Windows 95, Windows 98, and Windows Me will be discontinued with the next major version (1.7.0) of Cygwin.
- What Isn't Cygwin?
- Cygwin is not a way to run native linux apps on Windows. You have to rebuild your application from source if you want it to run on Windows.
- Cygwin is not a way to magically make native Windows apps aware of UNIX ® functionality, like signals, ptys, etc. Again, you need to build your apps from source if you want to take advantage of Cygwin functionality.
[edit] Install ImageMagick
- Download a windows version of ImageMagick [8] i.e. ImageMagick-6.3.1-7-Q16-windows-dll.exe.
- Edit c:\mediawiki\LocalSettings.php (Note that this file will not exist until you configure WikiMedia.)
$wgImageMagickConvertCommand = "C:/Program Files/ImageMagick-6.3.1-Q16/convert";
[edit] Configure MediaWiki
- Open your web browser and type "http://localhost/mediawiki" (if it is your virtual directory name) - it redirects you to "http://localhost/mediawiki/config/index.php".
- Review carefully options and their descriptions, then fill in the required fields - don't change default option - they are good to start MediaWiki - enable e-mails.
- If the configuration page complains that it cannot initialise a suitable database driver then look here.
- If the configuration page complains that it cannot find diff3 even though you installed cygwin and diffutils properly, then it's possible that your external commands are not executing. Open up /windows/system32 and right click on cmd.exe. Go to the Security tab and see if "Deny" is turned on for IUSR_YOURCOMPUTERNAME. If so, turn those off and Allow execute permissions on cmd.exe. That should fix the problem.
- At the end of configuration (if you grant suitable permission) you will see c:\mediawiki\config\LocalSettings.php file.
You could add some options by editing c:\mediawiki\config\LocalSettings.php to enable common features but it is not obligation to get working MediaWiki -> see full option list on [9]:
-
- enabling uploads
- image conversion
- copyright rights
- logo
- name spaces
- and so on ...
[edit] Move LocalSettings.php
- Move LocalSettings.php from c:\mediawiki\config to c:\mediawiki.
- Delete or Rename c:\mediawiki\config directory.
- Fix permission to secure state
- IUSR_YOURMACHINENAME read on c:\mediawiki
- IUSR_YOURMACHINENAME write on c:\mediawiki\images (if you plan uploads)
[edit] Patch MediaWiki
Use notepad++ and find all files in c:\mediawiki with string
$_SERVER['REQUEST_URI']
To replace to IIS compatible name of variable
$_SERVER['SCRIPT_NAME']
[edit] Run MediaWiki
Open with Internet Explorer http://localhost/mediawiki (if you not set index.php as default -> http://localhost/mediawiki/index.php)
[edit] Configure SMTP
Install from Windows System Installer additional component called SMTP (it is not installed by default Windows installation)
From IIS Console choose SMTP properties and restrict access for connections only to your computer 127.0.0.1.
Check if SMTP working by follow operations:
- telnet localhost 25
- then type
- HELO + <Enter>
- MAIL FROM: yourname@yourdomain.org + <Enter>
- RCPT TO: yourname@yourmailbox.org + <Enter>
- DATA + <Enter>
- Subject: Hello from my SMTP + <Enter>
- + <Enter>
- Hello, + <Enter>
- I am configured SMTP. + <Enter>
- . + <Enter>
- + <Enter>
- Open you favorite e-mail program and see if mail comes to your (if not check c:\windows\system32\logfiles\... or c:\inetpub\mailroot\drop for the reason)
[edit] Configure PHP SMTP
- Set suitable lines in PHP.ini (smtp server, smtp port, smtp e-mail from).
- Remember to set time zone in PHP.ini (if it will be not done - e-mail sending fails) i.e. timezone = Europe\Warsaw for more information about your time zone name see php documentation [10].
[edit] Check if MediaWiki Works with SMTP
- Create account or use WikiSysop to login to mediawiki
- Choose preferences and input your email
- Choose e-mail verification to send link to confirm your e-mail
- If everything works good:
- your will receive information e-mail send
- your will receive e-mail or two e-mails one after registration with invalid link and one after confirmation button selection with valid link
[edit] At The End
If you have some questions please e-mail to me 11:34, 29 September 2006 (UTC)), if you have some suggestions or want to improve this article on your experience please insert changes and sign --~~~~. I will fix content as soon as I see your comments - many of your suggestions was added to this article, so this version is really fresh.
--ChameleonRedOne 20:47, 14 February 2007 (UTC)
[edit] Your Suggestions
Q. How do I create a virtual directory?
(open 'Web Sites' -> 'Default Web Site' -> properties -> 'New' -> 'Virtual Directory' then follow the wizard).
--ChameleonRedOne 21:49, 19 February 2007 (UTC)
Q. This isn't Windows 2003 Server?
This tutorial is dedicated to Windows XP - it doesn't cover Windows 2003 but most thing are similar.
--ChameleonRedOne 21:49, 19 February 2007 (UTC)
It might make sense to add references to other Windows XP installation approaches? For instance [[11]] This looks to a neophyte like me a simpler process?
In reference to this documentation, IIS does not come 'installed' on XP though it is available via Add/Remove Windows Components so we might want to add some reference to that as well
Q. I am trying to install on my Vista box (IIS 7.0). But I am stuck where I have to add the .php extensiong in inetmgr . Can you elaborate more on this?
--PeterTC 23:48, 25 February 2007 (UTC)
A. Once you have the mediawiki virtual directory selected click on MIME Types and add in .php with the MIME Type of Application/php. then go to Handler Mappings and add a new script mapping. Put in the *.php for request path and either php-cgi.exe or php5isapi.dll as the executable. Hit OK and then yes to the pop-up. (remember to set PHPRC if you use isapi). if you have any more problems, make sure in the installed windows components you have selected CGI and ISAPI or else it will just return an error (I had this))
Regards, Justin
Q. I followed all of these steps on 3 different PC's but still the page won't open in Internet Explorer? I have been struggling for weeks to get this to work. Any help?
Notice: If you install under Windows and continually get an error:
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.
First thing you need to do is change the line in php.ini so it is cgi.force_redirect = Off
Q. I don't really understand what you mean in these sentence: "# Exit the console and go to the IIS file explorer. Grant access to IUSR_YOURMACHINENAME (your machine name is specific to your computer) by modifying directory permissions to C:\mediawiki\images from the IIS file explorer (if you plan to upload images)."
Q. I've completed above steps but when I try to access to wiki, browser displays an authentication popup; ie I cannot access the wiki anonymously. I've checked the configuration of the virtual directory under IIS but anonymous access is enabled there. I found the solution by changing the Account used for anonymous access field to another user. I know it is a serious security breach but I couldn't find another solution. Any ideas?
- A: There might be a problem with your file access rights or alternately with the IUSR_YOURMACHINENAME password method. Please check the following:
- Open a command-box (Start->Run->cmd.exe) and get to your wiki-directory (i.e. "c:" for changing to drive C and then "cd \inetpub\mediawiki" if Mediawiki is installed in C:\Inetpub\Mediawiki).
-
- Use the following command then: "cacls *.* /t /e /g Everyone:F"
-
- This command will modify your file access control lists so that everyone (including the IUSR-Account) has full rights to access the MediaWiki dir.
-
- Try anonymous access to MediaWiki then.
- If it doesn't fix the problem, use the following:
-
- As you did, create a user, mostly a guest, and let the IIS run with guest privileges... Please note that you have to give full access or read access to all dirs which the IIS uses (e.g. PHP, MediaWiki, Additional Websites and so on).
- Other method
-
- If you are using XP Pro, you can easily set another password for IUSR_YOURMACHINENAME user. Please turn off password-control in IIS Panel after you changed the password in Computer Management -> System -> Local users and groups -> users
-
- Right Click on IUSR_YOURMACHINENAME and use "set password" routine
-
- Turn off password-control in Computer Management -> Services and Applications -> Internet Information Services -> Websites -> Default-Webpage -> MediaWiki; Right-Click -> Properties on MediaWiki; Directory Security -> Edit; Anonymous Access -> Turn off password control through IIS and then type your password given in step before.
- ReneRomann 23:06, 13 April 2007 (UTC)
Emrey 13:15, 4 April 2007 (UTC)
Q. How can I configure MediaWiki to use SQL Server instead of MySQL?
Q. How come my new install instance of MediaWiki stopped working suddenly? It was working fine until I clicked on MainPage on the left box, then whereever I go, I just got a blank page in the web browser. Has anyone seen this before?
durnienp 01:22, 17 July 2007 (GMT) Reference above - I have also a similar problem (not sure if this is the right place!) However to be clear my wiki is working fine on the server. I get problems when porting it through a firewall! I have opened port 80 for web traffic but it seems intermittent. Particularly - it works when I clear the browser cache,history and cookies. I am unsure why this problem occurs.
--Durnienp 19:39, 23 July 2007 (UTC) A. Found that if I hold down ctrl (in IE7) then this forces browser refresh and bypasses cache. This seems to solve the problem
Q. Hi , this may be a very trivial question. I installed the mediawiki. i followed your step by step upto configuring SMTP. Now when I am running localhost/<mywiki>/index.php it is showing "Installation is successful. Click this link to go to ur wiki". Now how I am going to create the first wiki page of mine??This is where I am stuck.Any help will be really appreciated. ..Thanks ,Abhijit
Q. Quick installation of Apache/PHP on windows/Linux.
A. Install XAMPP, i could finish setup in 10 mins using XAMPP hope this helps you guys. http://www.apachefriends.org/en/xampp.html
-Rafique
Q. Installed everything as documented. Configured MediaWiki as per instructions. Moved 'LocalSettings.php' and patched it up as per instructions. Here comes the problem - now when I try to load up http://localhost/mediawiki/ the address resolves/re-directs to http://localhost/mediawiki/config/index.php/mediawiki/index.php?title=Main_Page which is a page that doesn't load. The page that needs to load is http://localhost/mediawiki/index.php?title=Main_Page. What am I missing? How can I fix the resolve/re-direct? ... Regards, Raghu
A. I figured out the solution: Lin 39 in "LocalSettings.php" change to reflect
$wgScriptPath = "/mediawiki";
Q. How do I install a database with MySQL so that when i fill in the fields for mediawiki 1.11.0 it doesn't error out and say invalid username and password? Comment by 198.176.189.201.
83.23.196.191 23:00, 28 November 2007 (UTC)
Q. I'm trying to install MediaWiki 1.11.0 in local computer (normal PC, not server) and I have a problem with database info -> I don't know what I must write in fields "Database name" , "Database username" and "Database password".. ;-( Only this is problem in installing, please help!!
83.23.196.191 23:08, 28 November 2007 (UTC)
Q. I installed Mediawiki 1.9.2 on a PC running Win XP Pro SP2, using IIS 5.1. It appears to work correctly, with the exception that the main page (http://localhost/mediawiki/index.php?title=Main_Page) saves a blank Temporary Internet File of itself. Thus, when I open the site a second time, it comes up blank. Any ideas for a fix for this?

