What is XAMPP?
XAMPP is one of the most popular environments for PHP development. It is a cross-platform distribution that helps you quickly turn your PC into a local web server.
XAMPP is a completely free, open-source, and easy-to-install Apache distribution that includes MariaDB, PHP, and Perl.
Step-by-step installation of MODX 3 on XAMPP
1. Download and install Xammp
The current version of the XAMPP installer can be downloaded from the official website Apache Friends.
Download the version for your operating system (Windows, Linux or OS X). After downloading, run the installation file and follow the steps of the installer.
We will not describe the installation process, since it is identical to installing other programs in your operating system. In fact, you only need to click the “Next” button.
Note 1. At the component selection step, you can leave only MySQL and PhpMyAdmin – this will be enough to install MODX 3.
Note 2: If your operating system is Windows 7 or higher, then during installation various windows from User Account Control and Windows Defender will most likely pop up – you need to allow everything.
Related materials on installing XAMPP (if something went wrong):
2. Checking the server’s functionality
To install MODX on XAMPP, you need to run two modules:
- Apache.
- MySQL.
You can do this from the Control Panel by clicking the “Start” button:
If everything is OK, the module data will turn green:
Now you can test the local server by going to the address in your browser: http://localhost/
. This page should open.
Now you can install MODX CMS on the server.
3. Create a local domain and upload MODX to it
Go to the server installation folder (usually C:\xampp), you can click the “Explorer” button in Control Panel and you will get there.
Find the htdocs folder there and go to it. Inside htdocs, create a local domain (it turns out to be a regular folder) with a name like modx3.com.
Now you need to upload the MODX files to the newly created directory (local domain). To do this, go to the MODX downloads page and download the “Advanced Installation Package”, unlike the “traditional package”, this package is lighter in weight and has a couple of additional steps that can be used to increase the security of MODX.
Unzip the archive, you will see 2 folders Core and Setup, copy (or cut / move) them to the modx3.com folder, and you should end up with the following.
You can usually unpack an archive using built-in functions or with the help of an archiver program, one of the best free cross-platform archivers is 7-zip (there are versions for Windows, Linux or MAC OS).
4. Create a Database and a User.
To create a database and a user for it in the Server Control Panel, opposite the MySQL item, click the Admin button
The PhpMyAdmin page will open in the browser (located at http://localhost/phpmyadmin/). In the top menu, go to the “User Accounts” tab. On the page that opens, click “Add user account”.
On the page that opens, fill in:
- Username: any, for example: modx3loc.
- Host name: choose local, the value should be substituted: localhost.
- Password: any, but preferably more complex, it is best to use a generator passwords.
Be sure to write down your login and password.
Next, in the “User Account Database” section, check the boxes next to the items: “Create a database with the same name and grant it all privileges.” and “Grant all privileges to what matches the pattern (username\_%).”
And in the “Global Privileges” section, click the checkbox opposite the “Check All” item
And at the very bottom, click the “Go” button, after which phpMyAdmin will create a database, a user, and assign the user as an administrator of this database.
5. Installing MODX
Run the modex installer, to do this you need to go to http://localhost/modx3.com/setup/
Note: if you want to get rid of localhost/ in the address (as in my screenshot below), you need to set up a virtual host (domain).
If everything is fine, the MODX installer will open immediately, with a choice of language. In my case, errors appeared – MODX installation cannot be continued:
2 PHP extensions are missing: gd and zip, how to enable them, read here: XAMPP. How to install / enable GD and ZIP. After that, reload the page and see the installer.
Select the desired language and click Next.
The next step will take you to a screen with some installation options:
In the next window: Site Configuration Key, leave everything as is and click Next.
A page with installation parameters will open, select new installation.
And below in the additional parameters, uncheck the “Send X-Powered-By header” item and click next
In the next step, specify the database connection information:
- Database type: mysql
- Database server: localhost
- Database name: modx3local
- Database user name: modx3local
- Database user password: the password that you specified (or generated) when creating the user.
- Table prefix: I recommend replacing the standard modx_ prefix with something more complex, for example: yfMSG_.
And click test.
If everything went well, select the connection encoding: utf8mb4 and mapping: utf8mb4_0900_ai_ci and click Test.
After that, fill in the default administrator data:
- Administrator email: any, but preferably a working one (it will help you recover your admin password if you forget it).
- Administrator login: any, the only thing I don’t recommend is using the standard one like admin.
- Administrator password: any, but preferably a more complex one, I recommend using an online password generator.
- Confirm password: enter the password there again. Don’t forget to write it down (this is the password for entering the admin panel).
- Click Next.
On the next page: Setting up the context, leave everything as is and click Next.
After which you should see the Installation Report, that all pre-installation tests were successful.
If everything is ok, click next and see the kernel installation report.
Okay, click next. After that, you will see the page: Thank you for installing MODX Revolution.
Click the Login button and you will be taken to the login page of the administrative panel.
All MODX is successfully installed, to get to the admin panel, enter the Username, password and click the Login button.