How to Install Magento 2.4.7 on Laragon (Windows 11 Guide)
Setting up a local development environment for Magento 2 can often feel like a daunting task, especially on Windows. However, using Laragon makes this process significantly smoother. In this comprehensive guide, we will walk you through the exact steps to install Magento 2.4.7 on Laragon running on Windows 11.
By the end of this tutorial, you will have a fully functional Magento 2.4.7 installation ready for theme development, extension building, or testing.
1. Prerequisites for Magento 2.4.7
Magento 2.4.7 has strict system requirements. To ensure a smooth installation, your local machine must have the following components ready:
- OS: Windows 11.
- Web Server: Apache (provided by Laragon).
- PHP: Version 8.2 or 8.3. (Magento 2.4.7 does not support PHP 8.1 or lower).
- Database: MySQL 8.0 or MariaDB 10.6+.
- Composer: Version 2.2 or later.
- Search Engine (Mandatory): Elasticsearch (7.17+) or OpenSearch (2.5+). Magento 2.4+ will not install without one of these.
2. Download and Install Laragon
Before configuring anything, you need to have the Laragon environment installed on your Windows 11 machine. Laragon is highly recommended for Magento because of its isolated environment and fast performance.

- Go to the official Laragon download page.
- Download the Laragon Full version (this package includes Apache, Nginx, MySQL, and PHP out of the box).
- Run the downloaded
.exefile and follow the installation wizard. - Important: Install Laragon directly in the root directory (e.g.,
C:\laragon) to avoid Windows permission issues later. - Once installed, open the Laragon app and click Start All to verify that Apache and MySQL are running without port conflicts.

3. Configure the Laragon Environment
With Laragon installed, we need to ensure it is running the correct PHP stack for Magento 2.4.7.
3.1 Switch to PHP 8.2 or 8.3 (If needed)
Magento 2.4.7 mandates PHP 8.2+. If your Laragon isn’t running this version by default:
- Download the PHP 8.2 (VS16 x64 Non Thread Safe) zip file from windows.php.net.
- Extract the zip into
C:\laragon\bin\php\. - Right-click the Laragon UI > PHP > Version and select your new
php-8.2.xfolder.
3.2 Enable Required PHP Extensions
- Right-click Laragon UI > PHP > Extensions.
- Ensure the following extensions are checked:
bcmath,ctype,curl,dom,gd,intl,mbstring,pdo_mysql,soap,sockets,sodium,xsl, andzip.

3.3 Configure php.ini Settings
- Right-click Laragon UI > PHP > php.ini.
- Search for and update these limits to prevent installation timeouts:
memory_limit = 4G
max_execution_time = 3600

3.4 Downgrade MySQL to 8.0
Newer versions of Laragon come packaged with MySQL 8.4, but Magento 2.4.7 strictly requires MySQL 8.0. Downgrading in Laragon is incredibly simple:
- Download the MySQL 8.0.x ZIP Archive from the official MySQL Community Downloads page.
- Extract the downloaded file and move the entire folder into
C:\laragon\bin\mysql\. - Right-click the Laragon UI > MySQL > Version and select your newly added
mysql-8.0.xfolder. (Pro Tip: If MySQL fails to start after switching, simply navigate toC:\laragon\data\and rename the existingmysqlfolder. Laragon will automatically generate a fresh, compatible data folder for version 8.0).
4. Install and Run Elasticsearch
Magento 2.4+ requires a search engine to install successfully.
- Download Elasticsearch 7.17 for Windows from the official Elastic website.
- Extract the folder to a simple path, like
C:\elasticsearch. - Open a Command Prompt or Laragon Terminal and execute:
C:\elasticsearch\bin\elasticsearch.bat - Leave this terminal window open. You can verify it is running by navigating to
http://localhost:9200in your web browser.

5. Create a Database
- Click Database in the Laragon UI to open HeidiSQL.
- Connect to your local server (usually
rootwith a blank password). - Right-click your connection > Create new > Database.
- Name the database
magento247and click OK.

6. Download Magento 2.4.7 via Composer
We will use Composer to fetch the Magento core files.
- Click Terminal in the Laragon UI.
- Navigate to the Laragon web root:
cd C:\laragon\www - Run the Composer command to create your project (replace
magento2with your preferred folder name):
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.7-p3 magento2

(Note: You will need your Magento Marketplace Public and Private keys for authentication).
7. Fix Magento_Theme Error
To fix Module ‘Magento_Theme’ Error, go to xampp/htdocs/{magento-folder}/vendor/magento/framework/Image/Adapter/Gd2.php and replace the following function with the below code:
private function validateURLScheme(string $filename) : bool
{
$allowed_schemes = ['ftp', 'ftps', 'http', 'https'];
$url = parse_url($filename);
if ($url && isset($url['scheme']) && !in_array($url['scheme'], $allowed_schemes) && !file_exists($filename)) {
return false;
}
return true;
}

8. Install Magento 2.4.7
Now, we execute the installation script.
1. In the terminal, move into your new project directory:
cd magento2
2. Run the installation command:
php bin/magento setup:install --base-url="http://magento2.test/" --db-host="localhost" --db-name="magento247" --db-user="root" --admin-firstname="admin" --admin-lastname="admin" --admin-email="[email protected]" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" --search-engine=elasticsearch7 --elasticsearch-host="localhost" --elasticsearch-port=9200
Laragon’s Auto-Virtual Hosts feature will automatically route http://magento2.test to your project folder.

9. Execute Additional Tweaks After Installed
Go to app\etc\di.xml, search Symlink and replace with Copy.


Next, fix Magento 2 admin blank page. In vendor\magento\framework\View\Element\Template\File\Validator.php, replace line 138 with:
$realPath = str_replace('\\', '/',$this->fileDriver->getRealPath($path));
Finally, run step by step these commands:
php bin/magento indexer:reindex
php bin/magento setup:upgrade
php bin/magento setup:di:compile
If you encounter an error related to PluginListGenerator.php while running the di:compile command, please refer to the following article: Fix Failed to Open Stream Error in PluginListGenerator.php in Magento 2.
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
If you have problems with the Admin Page: “Failed to send the message. Please contact the administrator”.

You need to disable the Two-Factor Authorization module using the following command:
php bin/magento module:disable Magento_AdminAdobeImsTwoFactorAuth Magento_TwoFactorAuth
After fixing TwoFactorAuth, if you log in but the admin login page remains refreshing after clicking Sign In, you can refer to this article: Fix Magento 2 Admin Login Page Reloading Issue on Windows.
Security Tip: For the best local performance and security, it is highly recommended to set your web server document root to the pub/ directory. You can do this by editing your project’s .conf file in C:\laragon\etc\apache2\alias.
So we have successfully installed Magento 2.4.7 on localhost. Here are the results:


Conclusion
Congratulations! You have successfully learned how to install Magento 2.4.7 on Laragon running Windows 11. By using Laragon instead of XAMPP, you benefit from a faster, more flexible local development environment.
If you encounter any issues or errors during the installation process, drop a comment below and we will help you troubleshoot!