Step 1: XAMPP and Composer
XAMPP
First of all, you need to download and install Xampp, a simple tool helps developers to create and test their applications on a local web server.
You might wanna go with PHP 8.1 since it got pretty solid support.
Next, run set up file and proceed with all steps to install Xampp. In Select Components step, make sure to select Mysql and PHP, PHPmyadmin.
Now open XAMPP and start Apache and Mysql, green color of Apache and MySQL indicates that its been started successfully.
COMPOSER
Now we need to install Composer, a tool for dependency management in PHP.
After the installation is complete, verify that Composer is installed correctly by running the following command
composer
If the installation was successful, the command should display the version of the installed Composer.
Step 2: PHP & MySql
Enable PHP extensions
We need to install and enable all required PHP extensions to make the installation go smoothly
bcmath ctype curl dom
gd hash iconv intl
mbstring openssl pdo_mysql simplexml
soap xsl zip ext-sockets
Quickly open php.ini on Xampp interface with this button
[PHP]
;extension=gd
;extension=intl
;extension=soap
;extension=xsl
;extension=sockets
;extension=sodium
;extension=zip
Remove ; from the above lines of php.ini file
. Save the file.
The other extensions are enabled by default after we install Xampp, so we don’t need to include them here. Remember to save files before exiting.
Configure PHP settings
In php.ini file, search and change the following values as below
max_execution_time=18000
max_input_time=1800
memory_limit=4G
These values will keep the installation go properly without interruption.
Finally, restart apache to apply php settings by click on apache Stop and Start button on XAMPP
Create database for Magento 2
Before we process the installation, we have to create a database for Magento 2 website to store all settings related to products, catalog, users, store configuration….
In Xampp interface, open PHPmyadmin by clicking on Admin button to open phpmyadmin
On phpmyadmin page, click on New => type database name => click on Create to create a new database. For example, I create magento2 database here
By default, Xampp does not set a password for MYSQL, so we will need to create a new root password for mysql.
On Xampp, click on Shell button to open command interface
Next, input the following command to change mysql root password
mysqladmin.exe -u root password root
and press Enter. I put root
as password.
Now, to use phpmyadmin, you will also need to enter the new password. To make phpmyadmin automatically login with your new password, Open config.inc.php , to open this file, see the screenshot below
And insert your new password here
Finally, restart apache to apply php settings by click on apache Stop and Start button on XAMPP
Step 3: Elasticsearch
Download
[Elasticsearch (https://www.elastic.co/downloads/elasticsearch)is now a required application to install Magento 2.4, the installation process will stop if there’s something wrong with Elasticsearch verification.
Next, unzip archived file at the “C:\xampp\htdocs\”
Install and Run
Go to \elasticsearch\bin
Right click on elasticsearch.bat
and select run as administrator
Leave this window running on background
Set Passwords
Before we continue, we must set password for all built-in users.
Open another terminal inside C:\xampp\htdocs\elasticsearch\bin
and run this command
./elasticsearch-setup-passwords.bat interactive
If you encounter this error
write the following line in /elasticsearch/elasticsearch.yml
:
xpack.security.enabled: true
Verify
To check if Elasticsearch is running on your system, open your browser and enter the following address: http:localhost:9200
. When prompted for login credentials, use root user elastic
and the password you just reset.
If you see this result page => Elasticsearch is running properly
Top comments (0)