Magento 2.4.2 introduces performance enhancements, security, and significant platform improvements. Security enhancement includes expansion of support for the SameSite attribute for all cookies. Also, Elasticsearch 7.9.x and Redis 6.x are now supported.
The store owners can offer a better shopping experience to their customers and leverage these benefits by upgrading to the latest Magento 2 version!
However, sometimes it may happen that you face some issues while installing Magento 2. Or you may make some mistakes while installation due to lack of expertise in Magento.
Hence, it is recommended to follow a thorough guide or seek expert help in installing Magento 2.
Here’s the stepwise guide that you can rely on to install Magento 2.4.2 on localhost using Xampp.
First, download Magento 2 and then follow the below steps:
Steps to Install Magento 2.4.2 on Localhost
- Run the below command after downloading Magento 126.96.36.199php bin/magento setup:install --base-url="http://127.0.0.1/mag242sample/" --db-host="localhost" --db-name="mag242sample" --db-user="root" --admin-firstname="admin" --admin-lastname="admin" --admin-email="[email protected]" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="INR" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin"
Common Magento 2.4.2 Installation Issues and their solution:
Admin Error 404
After passing the installation command, run the URL in the preferred browser. It’s displaying an error, as shown below.
Here’s a quick fix for that issue:
- Copy the index.php and .htaccess files from the pub folder and paste into the root directory.
- Both files are in the pub folder when we download the setup for security purposes, but we’ve to follow this step while installing in the local.
Replace the below line in the index.php file that we’d paste in the root directory.1require __DIR__ . '/../app/bootstrap.php';
with1require __DIR__ . '/app/bootstrap.php';
- Insert the below four rows in the core_config_data table.
Path Value web/secure/base_static_url http://localhost/m242/pub/static/ web/unsecure/base_static_url http://localhost/m242/pub/static/ web/secure/base_media_url http://localhost/m242/pub/media/ web/unsecure/base_media_url http://localhost/m242/pub/media/
- Pass the below command1php bin/magento cache:flush
Admin Blank Page Issue
Once solving Admin 404 Error, pass the URL in a browser and don’t panic if the admin page does not display anything!
Just follow our solution to solve the ‘Admin Page Blank Issue‘.
Here you go. After implementing a solution of the admin blank page, your Magento 2.4.2 store is ready to configure!
So that was all about installing Magento 2.4.2 on localhost using Xampp
Ask your doubts regarding this blog in the Comment section below.
I’d be happy to help.
Get Weekly Updates
Never miss Magento tips, tricks, tutorials, and news.
Thank you for subscribing.
Something went wrong.