Manual:Installing MediaWiki on XAMPP
(Redirected from Manual:Installing on WOS Portable (Windows))
It has been suggested that this page or section be merged with Manual:Installing MediaWiki.(Discuss) |
XAMPP can be used to get an environment for your MediaWiki installation up and running pretty quickly on your local machine or for a portable version on a USB drive if you use XAMPP Portable version.
Getting Apache and MySQL running
edit- Download the latest version for your platform (Linux, Windows, Mac OS X, or Solaris) from apachefriends.
- Run the executable to extract it (you can extract it straight to
C:\
if you want; it'll create an XAMPP subfolder and put all the files there) and answer the questions setup will ask you. Rename the folder to XAMPP. The minimum required components are Apache, MySQL, PHP and phpMyAdmin. - At the end, setup will give you an option to start the XAMPP control panel; select that option and it should pop up.
- Check the checkboxes for Apache and MySQL and click on their respective Start buttons to start those.
- If a port conflict occurs when starting the Apache web server, then the port for Apache must be changed, e.g. change 80 to 8080 (
httpd.conf
) and 443 to 4433 (httpd-ssl.conf
). The service ports inxampp-control.ini
must be changed in the same way. - You may encounter a MySQL port conflict in XAMPP if you have installed MySQL before in the system. In this case you need to change the port number for XAMPP. For example: https://stackoverflow.com/a/39741578/5632906.
- If a port conflict occurs when starting the Apache web server, then the port for Apache must be changed, e.g. change 80 to 8080 (
Creating your database
edit- Direct your browser to http://localhost/dashboard/ (or e.g http://localhost:8080/dashboard/ if the port has been changed to 8080)
- Go to phpMyAdmin at the top of the page
- Sign in
- Click Databases on the top bar.
- Choose a name e.g.
wikidb
, select a collation e.g. if your wiki is using utf8 for its default character set, then choose utf8_unicode_ci, and click Create) - Go into the new database and click on Privileges on the top bar.
- Click Add user account
- Enter a name for the user (e.g., wikiuser) and a password. For the hostname, select Local/localhost. You can leave all the rest blank. You may want to write down your database name, user name, and password, because you'll need those to install MediaWiki.
- Click the radio button for "Grant all privileges on database "xxx"
- For Global privileges select check all
- Click Go.
Editing PHP.ini
editTo make sure that the Apache HTTP server doesn't time out while creating the databases, modify the php.ini
config file:
- Open the
php.ini
file< (can be found in the folder/path_to_xampp/php
; in most Linux distributions, this file has the path/opt/lampp/etc/php.ini
) using your favorite text editor. Find the following section and change tomax_execution_time = 600
. - Look for "Dynamic Extensions" and make sure
extension=intl
is uncommented. If you have uncommented it you will need to restart Apache to load the extension.
Setting up MediaWiki
edit- Download MediaWiki
- Extract all your MediaWiki files and folders into a subfolder e.g.
mywiki\
of thehtdocs
folder, wherever that is e.g.c:\xampp\htdocs\
.
MediaWiki is downloaded as.tar.gz
file. To unpack such archive the following command can be used in Windows cmd or PowerShell:tar xzvf mediawiki-{{MW stable release number}}.tar.gz
- Direct your browser to the appropriate page, e.g. http://localhost/mywiki
- Follow the MediaWiki installer's instructions, entering the user name, and password you wrote down during the "creating your database" step above. Use 127.0.0.1 for the database name.
- If you enabled the "security" option, then you need to Use superuser account. This means the MySQL root account and its password.
- After MediaWiki tells you that everything went smoothly, save your LocalSettings.php file to your wiki's root folder, e.g.
c:\xampp\htdocs\mywiki
. - Direct your browser once again to the appropriate page, e.g. http://localhost/mywiki. It should take you to the Main Page of your new wiki. Congratulations! You're done.
- Add any extra extensions your wiki is going to require.
Backing-up
editMain page: Backing up a wiki
- In SQL admin, go to the wiki database (typically wikidb), and click Export. Check the first box under "structure" (DROP TABLES), and check the "save as file" checkbox near the bottom. Click Go and save the file to the backup location.
- Save a copy of the wiki folder, e.g. mywiki from
c:\xampp\htdocs\mywiki
to the backup location.
Restoring
editMain page: Manual:Restoring a wiki from backup
- Install XAMPP on the new server.
- In SQL admin:
- Create a new blank database with the default options and a name of your choice.
- Import the database file you backed-up.
- Change the SQL password of the root for that db (in privileges tab)
- Copy the wiki folder from back-up into the new htdocs folder.
- Change LocalSettings.php to reflect the new db username and password.
Maximum execution time exceeded
editIf you get Fatal error: Maximum execution time of xx seconds exceeded ..., edit the file config.inc.php
in folder phpMyAdmin and set:
$cfg['ExecTimeLimit'] = 0;
See also
edit- Manual:Streamlined Windows Install Guide
- Software bundles for AMPs with MediaWiki built in.
- Manual:Backing up a wiki
- Manual:Restoring a wiki from backup
- Manual:Performance tuning