Installing and Setting Up Your Own Web Server
Description: Installing developmental server on Widows so you can use phpBB on a local machine for testing purposes.
In Categories: Miscellanea
- Link to this article: Select All
[url=https://www.phpbb.com/support/docs/en/3.3/kb/article/installing-and-setting-up-your-own-web-server/]Knowledge Base - Installing and Setting Up Your Own Web Server[/url]
This article explains how to set up a developmental web server on your local computer complete with PHP, MariaDB, and phpMyAdmin using XAMPP software. While XAMPP is available for multiple operating systems and some of the instructions listed here will be applicable to those operating systems, this article is intended specifically for Windows based systems. It was written based on XAMPP version 7.4.7 for Windows, newer or older versions of XAMPP may have slightly different instructions.
Preinstall Notes
Download XAMPP
The newest versions of XAMPP can be downloaded from their main download page.
You must select a version of XAMPP with a PHP version supported by your version of phpBB. Numbering for the current versions of XAMPP are based on the PHP versions they utilize, e.g. XAMPP version 7.4.7 utilizes PHP version 7.4.7. If you need support for an older version of PHP because you have older version of phpBB, older versions of XAMPP are available from their archives.
XAMPP Installation
If you downloaded a zip file unzip it and move the "xampp" folder to the root of C drive. Do not place in Windows directories as it may cause permissions issues. Find the file
If you downloaded XAMPP's .EXE installer from their main download page double click the file to begin installation. Confirm that you wish to run the installer if any security warning boxes pop up.
At this point you may be presented with Windows Firewall alert. For security purposes click cancel to not allow it through the firewall. Note this may disable some phpBB features that require internet access like the version check in phpBB's administration control panel. The security of allowing XAMPP through your firewall is outside of the scope of this topic, consult their documentation.
You have now completed installation, click finish to open XAMPP's control panel.
Running XAMPP
In XAMPP's control panel click the Start buttons next to both "Apache" and "MySql." You do not need to start other services if they are listed. When starting MySQL you may get another prompt from Windows firewall, once again select cancel. "Running" should appear next to each of these services and the "Start" button should change to "Stop."
You can now check to see if it's working by visiting
Optionally you can configure Apache and MySQL to start automatically when XAMPP's control panel is started. Click the button labeled "Config" in the upper right, put a check next to Apache and MySQL under the section for auto start and save. The next time you start XAMPP they will start automatically.
MySQL User & Database Setup
Next we need to set up a new MySQL user and database for phpBB to use using phpMyAdmin. Next to the "MySql" option in XAMPP's control panel, click the "Admin" button. Your default browser will open phpMyAdmin, optionally you can open it in a web browser without XAMPP's control panel using
phpMyAdmin is a very popular web application for administering MySQL. It's also available in your hosting control panel for a live web site on nearly any host. If you're going to be using existing phpBB database/files or have database credentials provided by your live web host you can simplify things by utilizing them here. For an existing phpBB forum they can be found in phpBB's config.php file. You would need to contact your host for live web site.
You may use any credentials here but if for example your live web host issues you different credentials then config.php will need to be edited before uploading it to live web host.
On the top menu in phpMyAdmin click the "User Accounts" tab and then click the link "Add a new User" a little down the page on the left.
If you did not create a database in the previous step next we need to create one, click the Databases tab at the top of phpMyAdmin.
You should receive a confirmation that the database has been created and you are now ready to install phpBB.
XAMPP's htdocs Folder
Assuming you have installed XAMPP in C:\xampp, using Windows file explorer open the folder C:\xampp\htdocs. This folder is the equivalent of html_docs or similarly named folder on a live web server. When you open
The files and folders in XAMPP's htdocs folder are just sample files and can be safely deleted at this point. If you do not want to delete them move them somewhere else.
Using an Existing phpBB Installation with XAMPP
If you are using an existing phpBB database and files copied from a live web site it is best practice to follow existing directory structure. If the live forum is installed in example.com/forum/, create a folder in htdocs named "forum" and then copy your existing phpBB files and folders to it. You will also need to import your existing phpBB data into MySQL. Once you have completed both operations you should be able to access your local forum at
Fresh Installation of phpBB with XAMPP
For a fresh install of phpBB, download the newest version of phpBB, unzip the download and you should have a folder called phpBB3 which has many files and folders in it. If you want to access your forum from
Next open
When asked for the database information use the database name , username, and password we created in the steps above. Once phpBB is done installing delete the install folder in your phpBB directory. You should now be able to access the forum.
Note that if you are following an install guide here on phpBB.com, the instructions for setting file and folder permissions do not have to be done. However, if you upload these files to live server they permissions will need to be changed on live server.
php.ini Settings (optional)
One problem you may encounter with both XAMPP and a live server is limitations set in the php.ini for file sizes, script execution time etc. Importing a large database using phpMyAdmin for example can fail because of the file size or the length of time it takes. While these limitations are important for a live server, they can be set very high on local server. In XAMPP's control panel next to "Apache" click the "Config" button and select "PHP". This will open the php.ini file in your default text editor. Find the following values and edit them. Examples of higher values:
Once you edit these values save the file. In XAMPP's control panel click stop next to "Apache" and then click start.
Command Prompt (optional)
The button marked "Shell" in XAMPP's control panel opens a command prompt, Unix like commands can be issued from this command prompt. This can be particularly useful for importing and exporting large databases. It can also be used to issue commands to phpBB's CLI.
Windows Host File (optional)
phpBB is "smart" enough that the links it generates will use
Save the file, you may be prompted by Windows for administrative privileges to save the file. Once saved you should be able to access the local install in XAMPP when you use your browser to open the URL yourdomain.com. However, cache and DNS issues may be a problem. Minimally close the browser, reopen it and clear the browser cache. Further steps may be required, search the web for other options. Some browsers have extensions specifically for this.
To revert back to live domain once again open
Save the file, once again you may need to clear your browser cache and take other steps.
Multiple XAMPP Installations (optional)
If for example you want multiple versions of PHP available there are different ways you can do this. The easiest way is to have multiple copies of XAMPP. When you install or copy different different versions of XAMPP instead of the default folder name use one based on its version, if it's XAMPP version 7.4.7 name the folder xampp747. Find the executable file
Note that while you can have multiple copies of XAMPP on a system you cannot run them simultaneously.
Further Support
If you have questions concerning XAMPP related issues consult their documentation or you can try XAMPP's forum. If you are having trouble with using or installing phpBB you may use our Support Forum to help resolve those issues.
Preinstall Notes
- XAMPP supports current versions of Windows and some more recent ones, check the documentation on the version you are downloading for compatibility. Older versions of XAMPP can be downloaded from their archives if you need support for older versions of Windows.
- XAMPP comes with MariaDB which is MySQL compatible. The XAMPP installation package and control panel list it as MySQL. For the purposes of this article the names MariaDB and MySQL are interchangeable.
- If you have installed any previous web server or MySQL software, please uninstall or completely disable it before proceeding to ensure no conflicts arise.
- When accessing a https URL served from XAMPP the default SSL certificate used by XAMPP will not be valid and the browser will issue a warning about an invalid certificate. Your browser should have an option to make an exception and you can safely do that in this case.
Download XAMPP
The newest versions of XAMPP can be downloaded from their main download page.
You must select a version of XAMPP with a PHP version supported by your version of phpBB. Numbering for the current versions of XAMPP are based on the PHP versions they utilize, e.g. XAMPP version 7.4.7 utilizes PHP version 7.4.7. If you need support for an older version of PHP because you have older version of phpBB, older versions of XAMPP are available from their archives.
XAMPP Installation
If you downloaded a zip file unzip it and move the "xampp" folder to the root of C drive. Do not place in Windows directories as it may cause permissions issues. Find the file
xampp-control.exe
in the xampp folder and run it to start XAMPP. If you downloaded XAMPP's .EXE installer from their main download page double click the file to begin installation. Confirm that you wish to run the installer if any security warning boxes pop up.
- The XAMMP installation dialog box will present you with options to install different components, the default is to install all components and you can safely install all of them. Minimally you should have Apache, MySQL, PHP and phpMyAdmin selected. CLICK NEXT>>
- Next you need to indicate where you'd like to install XAMPP. The default is C:\xampp and recommended to avoid potential issues with Windows permissions. CLICK NEXT>>
- Select your language. CLICK NEXT>>
- The next dialog box is informational about Bitnami which can be used to install web applications like phpBB, Drupal and others in your XAMPP installation. phpBB recommends you do not use these installers for phpBB. Generally they may install out of date version of phpBB and sometimes may alter the installation. If you wish to immediately continue with the installation of XAMPP uncheck "Learn more about Bitnami for XAMPP". CLICK NEXT>>
- You are now on the "Ready to install " dialog box, click next again to begin installing XAMPP.
At this point you may be presented with Windows Firewall alert. For security purposes click cancel to not allow it through the firewall. Note this may disable some phpBB features that require internet access like the version check in phpBB's administration control panel. The security of allowing XAMPP through your firewall is outside of the scope of this topic, consult their documentation.
You have now completed installation, click finish to open XAMPP's control panel.
Running XAMPP
In XAMPP's control panel click the Start buttons next to both "Apache" and "MySql." You do not need to start other services if they are listed. When starting MySQL you may get another prompt from Windows firewall, once again select cancel. "Running" should appear next to each of these services and the "Start" button should change to "Stop."
You can now check to see if it's working by visiting
http://localhost/
with your web browser. You should be greeted with a "Welcome to XAMPP" web page. Optionally you can configure Apache and MySQL to start automatically when XAMPP's control panel is started. Click the button labeled "Config" in the upper right, put a check next to Apache and MySQL under the section for auto start and save. The next time you start XAMPP they will start automatically.
MySQL User & Database Setup
Next we need to set up a new MySQL user and database for phpBB to use using phpMyAdmin. Next to the "MySql" option in XAMPP's control panel, click the "Admin" button. Your default browser will open phpMyAdmin, optionally you can open it in a web browser without XAMPP's control panel using
http://localhost/phpmyadmin/
. phpMyAdmin is a very popular web application for administering MySQL. It's also available in your hosting control panel for a live web site on nearly any host. If you're going to be using existing phpBB database/files or have database credentials provided by your live web host you can simplify things by utilizing them here. For an existing phpBB forum they can be found in phpBB's config.php file. You would need to contact your host for live web site.
You may use any credentials here but if for example your live web host issues you different credentials then config.php will need to be edited before uploading it to live web host.
On the top menu in phpMyAdmin click the "User Accounts" tab and then click the link "Add a new User" a little down the page on the left.
- Enter a "User name".
- For "Host name" leave as default "Any host".
- Enter a password.
- If you wish to create a database with same name as the username you have entered check the box.
- Next to Global privileges check "Check All".
- At the very bottom click the Go button.
If you did not create a database in the previous step next we need to create one, click the Databases tab at the top of phpMyAdmin.
- Under "Create new database" enter a name for the database.
- In the drop down box select "utf8_bin".
- Click "Create".
You should receive a confirmation that the database has been created and you are now ready to install phpBB.
XAMPP's htdocs Folder
Assuming you have installed XAMPP in C:\xampp, using Windows file explorer open the folder C:\xampp\htdocs. This folder is the equivalent of html_docs or similarly named folder on a live web server. When you open
http://localhost/
in your browser this is the root directory used to serve files. The files and folders in XAMPP's htdocs folder are just sample files and can be safely deleted at this point. If you do not want to delete them move them somewhere else.
Using an Existing phpBB Installation with XAMPP
If you are using an existing phpBB database and files copied from a live web site it is best practice to follow existing directory structure. If the live forum is installed in example.com/forum/, create a folder in htdocs named "forum" and then copy your existing phpBB files and folders to it. You will also need to import your existing phpBB data into MySQL. Once you have completed both operations you should be able to access your local forum at
http://localhost/
, http://localhost/forum/
or whatever directory you copied the files to. Fresh Installation of phpBB with XAMPP
For a fresh install of phpBB, download the newest version of phpBB, unzip the download and you should have a folder called phpBB3 which has many files and folders in it. If you want to access your forum from
http://localhost/
copy all of the contents of the folder phpBB3 to htdocs. If instead you wanted to access it from http://localhost/forum/
, create a new folder in htdocs called forum and copy all the contents of phpBB3 to it.Next open
http://localhost/install/
with your browser or If you copied the files to sub folder point the browser there e.g. http://localhost/forum/install/
.When asked for the database information use the database name , username, and password we created in the steps above. Once phpBB is done installing delete the install folder in your phpBB directory. You should now be able to access the forum.
Note that if you are following an install guide here on phpBB.com, the instructions for setting file and folder permissions do not have to be done. However, if you upload these files to live server they permissions will need to be changed on live server.
php.ini Settings (optional)
One problem you may encounter with both XAMPP and a live server is limitations set in the php.ini for file sizes, script execution time etc. Importing a large database using phpMyAdmin for example can fail because of the file size or the length of time it takes. While these limitations are important for a live server, they can be set very high on local server. In XAMPP's control panel next to "Apache" click the "Config" button and select "PHP". This will open the php.ini file in your default text editor. Find the following values and edit them. Examples of higher values:
Code: Select all
upload_max_filesize = 999M
post_max_size = 999M
memory_limit = 1024M
max_execution_time = 999
Command Prompt (optional)
The button marked "Shell" in XAMPP's control panel opens a command prompt, Unix like commands can be issued from this command prompt. This can be particularly useful for importing and exporting large databases. It can also be used to issue commands to phpBB's CLI.
Windows Host File (optional)
phpBB is "smart" enough that the links it generates will use
http://localhost/
but this is not ideal. You can direct requests for your domain to XAMPP by editing Windows host file. Open C:\Windows\System32\drivers\etc\hosts
. Add these lines at end of file:Code: Select all
127.0.0.1 yourdomain.com
127.0.0.1 www.yourdomain.com
To revert back to live domain once again open
C:\Windows\System32\drivers\etc\hosts
and add a pound sign at the start of the lines:Code: Select all
#127.0.0.1 yourdomain.com
#127.0.0.1 www.yourdomain.com
Multiple XAMPP Installations (optional)
If for example you want multiple versions of PHP available there are different ways you can do this. The easiest way is to have multiple copies of XAMPP. When you install or copy different different versions of XAMPP instead of the default folder name use one based on its version, if it's XAMPP version 7.4.7 name the folder xampp747. Find the executable file
xampp-control.exe
and create shortcut to it to start XAMPP. Be sure to name the shortcut appropriately. Note that while you can have multiple copies of XAMPP on a system you cannot run them simultaneously.
Further Support
If you have questions concerning XAMPP related issues consult their documentation or you can try XAMPP's forum. If you are having trouble with using or installing phpBB you may use our Support Forum to help resolve those issues.
- Jun 27, 2020 - full revision by thecoalman
- May 22, 2010 - originally authored by AdamR