Creating a Joomla! test site on XAMPP
- Install XAMPP for Windows
- Access XAMPP Control Panel
- Configure for Joomla!
- XAMPP Notes
- Creating the Database
- Install Joomla!
- Appendix 1 Installing Notepad++
- Appendix 2 - Adding email support
- Appendix3 -Using an Akeeba Backup
Often one wishes to test an existing site, perhaps to test an upgrade before committing on the 'live' web site. So in Appendix 3 there are notes on using an Akeeba backup This assumes you have set up and configured XAMPP as noted in the main part of this article.
As at March 2023 the recommend version of PHP is PHP 8.0 or higher for both Joomla! 3.10 and Joomla! 4. For Joomla 4 the minimum is PHP 7.2.5 and for Joomla 3.10 it is PHP 5.3.10.
For the database Joomla recomends:MySQL and Progress. Note however that many come with MariaDB which is a fork of MySQL by the original 'open source' developers.
- MySQL 5.5.3+(J3) and 5.6+ (J4) [or MariaDB-10.2]
- PostgreSQL (J3 9.1+) (J4 11.0+)
- Apache 2.4+ (J3 and J4)
- Nginx 1.18+(J3) 1.8(J4)
- Microsoft IIS 7 (J3 and J4))
In my experience it is also necessary to download and use the free Notepad++ text editor rather than attempt to struggle with the default Win10 Notepad which is, in a practical sense, useless for editing php and similar files. You can get Notepad++ from https://notepad-plus-plus.org/ (opens in a new window/tab)
It would probably repay the effort if you practice a little to become familiar with Notepad++
Another useful free utility program is 7zip to unpack zip files, not essential but I would highly recommend it. This is available at https://www.7-zip.org/ (opens in a new window/tab)
Also with XAMPP on a local PC then the Joomla! features 'Install from the Web' and 'Auto updating of Joomula!' work OK but personally I tend to download the actual 'update', probably because I have several sites to update!!
In this article XAMPP is installed on drive C. If you have another disk drive, say D, then it may be set up on that drive instead.
Most of the effort is in configuring of XAMPP for Joomla!. Once that is setup it is then simple to create multiple test sites.
Install XAMPP for Windows
So download your chosen XAMMP to a suitable location, typically your regular Download location.
Then go to that location and right click on the downloaded file. You may be asked if you want to run this file and then be asked if you wish to allow changes to be made.
Select Yes in both cases.
A warning might come up about having Anti-Virus software running.
If you do decide to turn off your anti virus it might also be useful to temporarily disconnect from the web. Actually I always leave the anti virus running and have not had a problem.
Yet another warning that may occur is about User Account Control. As we are not installing in C:\Program Files (x86) but in directory C:\xampp there is no conflict.
The actual install now begins!
So click on the Next > button.
The first stage is the overall configuration of XAMPP.
It is advisable to select all of the options, which is the default, as they may be required at a later stage.
So again click on the Next button
Agree to the selected folder as shown, namely
and again click on Next
Note if installing on a different drive then use the relevant drive letter.
An ‘advert’ for Bitnami will appear. This is sometimes useful to aid with the Joomla! Installation. Personally I prefer to do the installation directly.
So I would untick the ‘Learn more about ...’ and click Next >
If you do leave it ticked it takes you to your browser but does not interfere with the installation.
The next page is basically just the progress window whilst XAMPP in being installed.
As this takes a few minutes it might be a good idea to take some refreshment!
Finally we get to completion.
Leave the "Do you want to start the Control Panel now?" ticked so that it will start the Control Panel initially.
Because it is a new installation you will be asked about a language choice.
After selecting the language then the XAMMP Control panel will appear, as shown opposite.
As indicated it is neccessary to click on the Apache and the Mysql Start buttons so that they both have a green backgroud indicating they are active.
Access XAMPP Control Panel
Actually at this stage I close the XAMPP Control Panel and go to the Windows ‘panel’ which lists all the Apps and scroll down to the XAMMP entry. Click on XAMMP to show the sub menu.
Then Right Click on 'XAMMP Control Panel' which then shows another menu as illustrated on the far right. This will add a regular Win10 sub pane so you can get to the XAMPP control panel easily on future occasions. It will also allow you to run the control panel as an Administrator which more recent versions of XAMPP indicate as being beneficial.
See also the section later about creating a short cut on your desktop.
Configure for Joomla!
Experience shows that you will need a better editor than the default Microsoft Notepad text editor. A suitable editor is Notepad++ available from Download Notepad++ (opens in a new window/tab).
Details on installing Notepad++ are given in an Appendix.
Finally click on the button.
If an Access Denied message, such as shown opposite, then there is a Windows Security issue which is readily resolved.
With File Explorer search directory C/xampp for xampp-control.ini. Then Right Click and select Properties
In this example I have selected Everyone but it could be restricted to Admin users.
The Permissions show that at present the file only has read access. So click on the Button.
Next Click on Full Control, which will set all permissions as shown. Finally click OK.
For more information on Windows security there are many articles on the web such as
Acces is Denied in Win10 (opens in a new window/tab)
Use file Explorer to navigate to C:/Windows/xampp and find program xampp-control.exe. Right click on the name and select 'Send To', then choose 'Desktop (create shortcut)' as illustrated opposite.
When you click on the icon then the XAMPP Control Panel will appear.
The two essential applications are Apache and MySQL.
To edit open php.ini in Notepad++. With a fresh XAMPP install the settings output_buffering and display_errors need changing to meet Joomla! Recommendations. As you are running on your own PC then there are other settings that are useful to change, specifically max_execution_time and max_input_time. For jDownloads then I would recommend changing both post_max_size and upload_max_filesize to allow for larger file uploads.
The suggested values are:
1. post_max_size = 100M
2. upload_max_filesize =102M
3. max_execution_time=200 (this parameter is not usually available to users on regular web servers)
4. max_input_time=200 (this parameter is not usually available to users on regular web servers)
5. output_buffering=Off (xammp default is usually output_buffering=4096)
6. display_errors=Off (xammp default is usually On)
The actual GD library is normally located in C:/xamp/php/ext
For PHP8 the file is called php_gd.dll but for PHP7 and earlier it is php_gd2.dll.To activate the library find in php.ini the so called 'extensions section'. This section contain lines such as extension=bz2 extension=mbstring and so on.
Again using Notepad++ or similar edit php.ini
For PHP8 add the line extension=gd
For PHP 7 and earlier add the line extension=gd2
So in php.ini search for extension=intl and remove the semi-colon ; at the start of the line (NB it may already been uncommented). Also check that extension php_intl.dll is located in directory xampp/php/ext as this is the location from which the dll is loaded.
This Internationalisation extension (Intl) is a wrapper for the ICU library, a set of C/C++ and Java libraries that provide Unicode and Globalisation support for software applications. It enables PHP scripts to perform UCA-conformant collation and date/time/number/currency formatting.
If the button shows Stop then it is running,
When running Apache has a green background .
If it shows Start it is inactive .
Accessing phpMyAdminAccess will be needed to the phpMyAdmin utilty to create the database and create a user with a password.
There are several ways of doing this but perhaps the most convenient is to Click on the Admin button in the MySQL line on the XAMPP Control Panel.
Another simple way is to use a new tab in your Browser and execute localhost/phpmyadmin/
First we will check that we have direct access to phpMyAdmin so click on the Admin button on the MySQL line.
This will take you directly to the base page so then Click on User Accounts. This will open a new tab, or window, in your browser.
At this stage we are just checking!! So do NOT do anything like clicking on priveleges!!
You can see that none of the accounts have a password set. The next steps below will modify the root localhost to have a password.
Now exit by closing the browser tab (or window).
Set root passwordBy default the root user on localhost has no password. But Joomla! Sites require one!
That is we need to set a password for the User root on the localhost.
The steps required to achieve this are given below.
Halt MySQLWe need to edit one of the XAMPP files (config.inc.php) so it is essential to ensure that MySQL is not running.
Do this by accessing the XAMPP Control Panel and ensuring that the state of MySQL is showing Start as illustrated opposite. If it is showing Stop then click on the button and after a short time it should change to Start.
Edit config.inc.phpThe second step is to edit the file C:/xampp/phpmyadmin/config.inc.php using Notepad++
(Notepad does not support the 'newline' characters so it looks like one huge long string).
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
ONLY change the line $cfg['Servers'][$i]['auth_type'] = 'config'; to read $cfg['Servers'][$i]['auth_type'] = 'cookie';
Do not be tempted to change the other lines!! Save and exit Notepad++.
Next on the XAMPP Control Panel click on the button opposite MySQL so after a few moments it shows Stop
Change PasswordUse localhost/phpmyadmin/ in your browser which will take us directly to the phpMyAdmin utility where you should see a log in screen such as shown opposite.
Presently the log in name is root and there is no password so leave that field blank.
This will give the General Settings screen as shown opposite but note it now has a link to a Change password command.
This was not available previously.
Clicking on the Change Password option brings up the form shown opposite where the new password may be entered.
The change of password will be acknowledged with a message such as shown opposite.
LogoutThe purpose here is to prove we can re-login.
On the left hand side of the screen there are various 'control' icons.
One of these is the Log out button as shown opposite.
So Log Out and then a log in screen will appear.
Now you will need to give the new password in order to log in.
After logging in if you now select User Accounts on the menu bar you should see that user root on localhost now has a Yes in the Password Column.
Log out of phpMyAdmin by clicking on the logout button as shown in stage 5, close the browser window and we are finished.
And make sure you keep a copy of the password in a safe place.
XAMPP NotesThe Installation of XAMPP is now complete. So now we can concentrate on making Joomla! or other websites for local use, especially for testing purposes.
In XAMPP if we wish to have a web site called say 'test', then the web site root is in directory C:/xampp/htdocs/test . Another website, called say 'beta-test', would have a root at C:/xampp/htdocs/beta-test .
To access these from the browser the link would be http://localhost/test/ or http://localhost/beta-test as appropriate. Usually with a modern browser the http:// part may be omitted.
If you have re-booted your computer and then try to access your XAMPP test site then you may get a message like "Unable to connect" or "Could not find site" or similar. Just go to the XAMPP control panel and you should see Apache and MySQL starting up.
Updating XAMMPFrom time to time it may be helpful to update XAMPP to say use a more recent version of PHP.
An article which gives a comprehensive view of the way to do this is
How to Upgrade XAMPP in Windows (opens in a new window/tab)
As well as a procedure for updating PHP, a method of installing a new version of XAMPP and then transferring your existing test site or sites to the new version is shown near the end of the article. If you do choose the 'transfer' scheme then you will need to 'configure' the new XAMPP as noted for a first time installation above. This is much less work and in my view a lot less 'risky'. The following steps have been taken from the article.
- Run the installation and choose a different destination folder for it – if your old XAMPP version is installed to C:/xampp/ folder, install the new version to C:/newxampp/
- After successful installation transfer the C:/xampp/htdocs/ folder to C:/newxampp/htdocs/ – this will transfer all of your project files to the new installation.
- Also transfer the C:/xampp/mysql/data/ to C:/newxampp/mysql/data/ – this will transfer all database information to the new installation.
- Open the new XAMPP Control Panel v3.xx – and start Apache and MySQL.
- Now check the php version find php version (opens in a new window/tab) This opens the entire php info file, the PHP version is on the first line.
Creating the Database
In this Example we will create a database called ‘jdx39’ and set a collation of utf8mb4_unicode_ci as that will support all characters in all languages.
We have already created a user ‘root’ on local host with a password so we will use that when installing Joomla! We can use this database user for any site so there is no need to create multiple database users.
Recall that in your browser use localhost/phpmyadmin to get the login page. After logging in you will see the main page. Then on the left hand side of the screen click on New.
Actually in the image shown jdx41 has already been created
As shown opposite user ‘root’ on host ‘localhost’ has all privileges for database ‘jdx41’.
Install Joomla!The first step is to create the relevant directory, which in this example will be jdx41. Note that using the same name for the site name and for the database name is very convenient when dealing with multiple sites on XAMPP. But never do that on public sites.
Create a new directory called jdx41 in C:/xampp/htdocs with Windows Explorer. Joomla! Is available at https://downloads.joomla.org/cms.(opens in a new window/tab) It is packed in three type of compression. As at August 2023 both Joomla! 3 and Joomla! 4 are available. In this example we will use the latest Joomla! 4. Joomla! is available in 3 packing types :
- Joomla! 4.3.4 Full Package (.tar.bz2)
- Joomla! 4.3.4 Full Package (.tar.gz)
- Joomla! 4.3.4 Full Package (.zip)
For Windows 10 the best one to download is the zip version, personally I always use the zip version whenever downloading.The next step is to unpack the download into the target directory xampp/htdocs/jdx39. Windows 10 has an inbuilt unpacking tool or you can use something like the free 7-Zip utility available from https://www.7-zip.org/ (opens in a new window/tab) which is much quicker and more flexible!
Right clicking on the downloaded zip file will show the options including Extract All and, if installed, 7-Zip.
If you click on Extract All then, by using the browse button,you will be able to specify where the extracted files are to be placed, in this example C:\xampp\htdocs\jd39.
When the extraction is completed then we will be able to start the installation proper.
To start the installation process go to your browser and enter localhost/jdx39/index.php.
This will then show the first configuration page as illustrated opposite.
Fill in the details as indicated and click on the button.
Here we setup the login details
We now have to let Joomla! know the details of which database and which database user are to be used.
Note that the database user is NOT the same as the Joomla Super User.
One may however choose to use names that happen to be identical but it is preferable, and more secure, if different names are used.
Next click on button.
You can choose to go to the front end by clicking on the button or to the backend by clicking on the
Personally I always choose to open the backend (admin)
and for the front end enter localhost/<site-name>
Appendix 1 Installing Notepad++
It is available in 32bit and 64bit versions.
In this example we will configure XAMPP to use the 64 bit Notepad++ as the default editor.After installation Notepad++ will be in location C:/Program Files. The 32 bit version would be in C:/Program Files(x86).
Get the XAMPP Control Panel on screen, by using your short cut or otherwise, and then click on the Config button at top right.
The full reference for the 64 bit version is typically C:\Program Files\Notepad++\notepad++.exe
On the same screen, tick Autostart for Apache, MySQL and if required FileZilla and the other applications you may need.
This means when you click on the XAMPP Control shortcut the applications will start up automatically.
Generally not a good idea to 'tick' the Start Control Panel Minimised option.
You must of course Save.
At this juncture you may get a message such as shown opposite.
This is actually a Windows 10/Win 11 file access 'challenge'.
Using Explorer access file
C:\xampp\xampp-control.ini and right click on it and select 'Properties'. Then select the Security tab as shown opposite.
This will show that the file only has Read access as seen in the first image opposite.
Click on the edit button and give the file write access.
Appendix 2 - Adding email support
Further it is assumed here that you wish to have a secure transmission so it is neccessary to invoke SSL (secure sockets layer)
These notes are based the answer given by Vikas Dwivedi in https://stackoverflow.com/questions/15965376/how-to-configure-xampp-to-send-mail-from-localhost (opens in a new window/tab
You will of course need the settings from your mailserver, including the password, the SMTP port number and the equivalent SMTP= value which is typically 587 or 465.
In this example the fictious email address 'somewhere.com' is used which you need to replace with your target email location.
For additional clarity the items you need to 'personalise' are shown in bold in this appendix.
So in C:\xampp\php\php.ini first find 'extension=php_openssl.dll' and remove the semicolon from the beginning of that line to make SSL work for localhost.
Then again in php.ini file find [mail function] and change so that you have as below. Note you might find that there are comments such as 'For Win32 only' and 'For Unix only'. These are historic so do not be put off!
sendmail_from = firstname.lastname@example.org
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
Next in xampp /sendmail/sendmail.ini make the settings as below, again using the appropriate email address, SMTP port and password.
The final stage is to test using the Jooma! Test Mail button in System -Global Configuration - Server tab - Mail Settings.
After setting Send Mail to Yes, do not forget to set the 'From Email' and the 'From Name' fields to the proper values.
Finally click on the Send Test Mail button. You should see a confirmation message such as shown on the far right.
If you do not receive the email it maybe because you have not configured the email set up on your device!
There are some preliminary steps:
- Create a new database eg jdtestdb - see Creating a Database for details, noting we can use the same User and Password.
- Create a new directory with the required name for the test site in xampp/htdocs/ eg jd-test
- Download the kickstart utility from https://www.akeebabackup.com/download.html (opens in a new window/tab) and extract kickstart.php from the zip file.
- Rename kickstart.php to say jdtest-restore.php (kickstart checks its name is not kickstart when you run it!!)
- copy renamed kickstart into the new directory eg copy jdtest-restore.php to xampp/htdocs/ jd-test
- Copy the Akeeba backup itself, which is usually a jpa file, to the new directory. Also if it is a large backup the there might also be files with extensions .j01, j02 and so on which should also be copied to the new dircectory.
- Open your Browser and go to localhost/<new dir>/jdtest-restore.php assuming you renamed kickstart.php as jdtest-restore.php.
The first two steps are illustrated below. As there is only one backup it it automatically selected. Similarly the extraction method is the regular method.
Section 3, which is the Fine Tune section, is normally left alone except for the 'Rename Server configuration files' which is ticked to hide some key files during the restoration.
The next step starts the file extraction process and a progress bar is shown after starting the extraction.
The time taken for the extraction obviously depends on the siz of the website being restored.
If an error occurs then consult the Akeeba Kickstart Documentation (opens in a new window/tab) for the cause and solution.
In due course the next stage of running the installer is reached.
After starting the Installer, which runs in a new tab or window, it checks that the php settings are ok.
As these were set up when doing the initial XAMPP installation no incompatibility is expected.
There will also be other 'panels' showing information from the backup and from the site. These need to be looked at to ensure the information is consistent with what is expected.
The first step here is to fill in the details of the new database created in XAMPP.
Setting he Database Type as MYSQLi and the Host Name as localhost are the usual settings.
The User Name, the Password and the Database Name need to be filled in as appropriate.
The required prefix is usually already entered and is probably best left.
If you are unsure there is a very useful button that shows additional help.
After initiating the restoration then a bar shows the installation progress. Finally, if all is well, there will be a completion message with a button to take the next step.
If there is a problem then consult the Akeeba Kickstart documentation. (opens in a new window/tab)
The site parameters for the new site will differ in some aspects from the original site.
For example XAMPP detects the new site is running in a Windows environment and advises appropriately.
The site name probably need changing to minimise confusion, and similarly the email items may well be better changed so as to identify which site, the original or the test site, sent an email.
A very important setup item is to leave both the Cookie Path and the Cookie Doman blank. If you leave or set the original contents you will not be able to login!
If the log and tmp paths are not the normal Joomla! settings such as
/home/<site-specific>/public_html/logs or tmp respectively, then it would be best to tick the override box.
Another significant area that needs attention are the special files such as php.ini, user.ini and the .htaccess files. It is most likely that the setup of those files are very specifice to the original site and most likely inappropriate for the new test site.
So it is advisable to remove the user,ini and php.ini files as they are used to customise the PHP setup which has been dealt with earlier for XAMPP.
Similarly it is recommended use the default Joomla .htaccess file so tick the relevant box as indicated opposite. You could also choose to delete the .htaccess and .htpasswd files.
There is a directories fine tuning panel that allows specifying the Site root and the log and temporary directory locations as illustrated opposite.
Obviously use your directory in place of jd-test.
Another Panel allows setting the super user details, as illustrated on the far right. Selecting one of the existing super users then allows changing the email and password, again to minimise confusion between the two sites.
Clicking on the Continue button brings up the instruction to close the window as shown opposite.
After closing the window/tab then the Clean Up Button is shown as illustrated on the far right.
So after the Cleanup, all is nearly done and one can check both the front end and backend are accessible.
But there is one more item related to jDownloads.
If you go to the jDownloads Control Panel you may see a notice like the one opposite.
This is because the path will refer to the original location.
So go to Options - Path Settings - "upload directory path" - and change the existing contents to
where jd-test is replaced by your directory, and Save. Note the use of double //
We are done!
ColinM Dec 2018, revised October 2021, August 2023