In this tutorial the setup of a local development environment under Windows is described using Laragon as an example.
With Laragon WAMP a local software stack consisting of the following server components is installed:
The installation package also includes other useful tools, which will not be discussed here, but you can find more information about Laragon (installation, features, etc.) in the official documentation.
Windows 7, 8, 8.1, 10
This manual describes how to install Laragon on Windows 10 (64-bit).
The security concept of current Contao versions (specifically Contao 4.x and higher) requires that symbolic links (symlinks) have to be created for the proper operation of the web application. However, creating symlinks under Windows usually requires administrator rights. It is therefore recommended that the ordinary Windows user also be granted the appropriate right to create symlinks. The easiest way to do this is to use the free Polsedit tool. The ZIP archive contains both a 32-bit and 64-bit version of Polsedit and can be run directly without installation.
ToDo: Configure permission to create symbolic links in Group Policy
polseditx64.exe(64 bit version)
The installation of Laragon should be intuitive and largely self-explanatory via the guided installation process. The latest release of the WAMP stack can be downloaded directly from GitHub in the appropriate version.
ToDo: Download and install Laragon
laragon-wamp.exe. Under certain circumstances, a message from the Windows Defender SmartScreen may appear at this point, indicating that the start of an unknown app has been prevented. However, the link “More Information” allows you to “Run anyway”.
In the future, Laragon can be accessed via the corresponding new entry in the Windows Start menu or via the Laragon shortcut icon on the Windows desktop. After starting the application, a program icon appears in the Windows notification area (System Tray) that also displays the status of the services (started or stopped) and can be used to open the Laragon management panel:
Laragon can be adapted and configured relatively easily. For example, the “Create new website” feature can be used to completely automate the installation of a new Contao instance so that a fresh Contao installation can be set up with just a few clicks.
ToDo: Define settings in Laragon and configure apps
The Laragon configuration settings are stored in the file
laragon\usr\laragon.ini and can of course be changed
there as well.
[php]add the PHP
sys_temp_dirvariable to the values of the key
QuickSettings=xdebug, max_execution_time, upload_max_filesize, post_max_size, memory_limit, sys_temp_dir
C:\laragon\tmp(adjust the Laragon root directory if necessary, if Laragon is not installed on the drive
C:\under the default path):
In the same submenu, the Laragon environment variables can be removed if necessary. You can also use the menu item “Manage Path” to check if the path information has been added correctly to the PATH environment variable.
The app configurations are saved to the file
laragon\usr\sites.confthe contao-specific adjustments can now be added:
# Options AutoCreateDatabase=true Cached=true # Blank: an empty project Blank= ------------------------------------------------------ # Contao 3.5 Contao 3.5 Website …=composer create-project contao/core %s 3.5.* # Contao 4.4 LTS Contao 4.4 Website …=composer create-project contao/managed-edition %s 4.4.* && curl https://download.contao.org/contao-manager/stable/contao-manager.phar -o %s/web/contao-manager.phar.php # Contao 4.9 LTS Contao 4.9 Website …=composer create-project contao/managed-edition %s 4.9.* && curl https://download.contao.org/contao-manager/stable/contao-manager.phar -o %s/web/contao-manager.phar.php ------------------------------------------------------ # Wordpress Wordpress=https://wordpress.org/latest.tar.gz # Joomla ### Joomla=https://github.com/joomla/joomla-cms/releases/download/3.8.11/Joomla_3.8.11-Stable-Full_Package.tar.gz # Prestashop ### Prestashop=https://github.com/PrestaShop/PrestaShop/releases/download/22.214.171.124/prestashop_126.96.36.199.zip ------------------------------------------------------ # Drupal Drupal 8=https://ftp.drupal.org/files/projects/drupal-8.5.5.tar.gz ### Drupal 7=https://ftp.drupal.org/files/projects/drupal-7.59.tar.gz ------------------------------------------------------ # Laravel Laravel=composer create-project laravel/laravel %s --prefer-dist Laravel (zip)=https://github.com/leokhoa/quick-create-laravel/releases/download/5.6.21/laravel-188.8.131.52z ### Laravel dev-develop=composer create-project laravel/laravel %s dev-develop ### Laravel 4=composer create-project laravel/laravel %s 4.2 --prefer-dist ### Lumen=composer create-project laravel/lumen %s --prefer-dist ------------------------------------------------------ # CakePHP ### CakePHP=composer create-project --prefer-dist cakephp/app %s # Symfony 4 Symfony=composer create-project symfony/website-skeleton %s
Of course, the app configurations of the other web applications can also be removed or commented out, as long as they are no longer needed.
Using the parameter
AutoCreateDatabase in the section
Options you can configure whether databases should also
be created automatically or not. By default, every newly created web project will also create a new, empty database
with the same name at the same time.
The changes in the
laragon\usr\sites.conf are immediately active after saving; Laragon does not need to be restarted.
Although Laragon already comes with Composer, it may be necessary to install the PHP dependency manager globally on the system.
ToDo: Install Composer globally
Composer-Setup.exeand follow the guided installation process in the setup wizard:
php.exeshould be able to determine the path to automatically, provided the Laragon Paths have been added to the Windows PATH environment variable as specified above.
laragon\wwwnavigate to the Laragon directory in Windows Explorer, right-click on it to start the “Console” and, for example
php -v, execute and
composer -Vrun it:
As mentioned before, the Laragon feature “Create a new website” allows you to create a new website based on any version of Contao relatively quickly and with just a few clicks. Laragon will automatically create the empty database and configure the virtual host.
ToDo: Set up a new Contao installation
mycompanyin the input field (if possible, the project name should not contain any special characters, because it is also used as database name) and confirm with “OK”:
127.0.0.1 mycompany.local #laragon magic!
Contao front end: http://mycompany.local/
Contao back end: http://mycompany.local/contao (or http://mycompany.local/contao/login)
Contao installation tool: http://mycompany.local/contao/install
Contao Manager: http://mycompany.local/contao-manager.phar.php
(The system check of the Contao Manager should automatically detect the path to the PHP binary if a manual configuration is selected in the server configuration via “Other …")
If the browser software performs a web search for this keyword when entering, for example, contrary
to expectations, the schema or network protocol
http:// should also be specified when calling, i.e.
Appendix with further information/tasks:
ToDo: Install the latest version of Laragon
laragon.exeone in the Laragon installation directory with the previously downloaded executable.
ToDo: Remove an existing website project
ToDo: Install Contao Official Demo
composer require contao/official-demo
Depending on the Contao version, it might be necessary to request the appropriate version of the Contao Official Demo (COD). For Contao 4.9, this would be the case:
composer require contao/official-demo:4.4.0
Like any other package/bundle, the Contao Official Demo (COD) can be installed in the same way via Contao Manager.
ToDo: Install phpMyAdmin
phpMyAdmin-x.x.x-all-languagesin phpMyAdmin (Attention: Please note that the folder name is case sensitive!)
phpMyAdminincluding all files and subfolders to
laragon\etc\apps\. In the folder
laragon\etc\apps\phpMyAdmin\duplicate the example template of the phpMyAdmin configuration file
config.sample.inc.phpand rename the copy to
config.inc.php. Edit the configuration file
config.inc.phpand adjust the settings as follows
/* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = true; $cfg['Servers'][$i]['port'] = 3306; $cfg['LoginCookieValidity'] = 36000;
http://localhost/phpmyadmincall phpMyAdmin via
The Apache alias configuration for phpMyAdmin is located in
Sometimes you need PHP 5.6 for older web projects, but you want to test new features with PHP 7.3. In the following, both PHP 5.6 and PHP 7.3 will be made available in Laragon.
ToDo: Add more PHP versions and switch between the different PHP versions
laragon\bin\phpinto the corresponding folders (
-x64–> Apache: VC11
-x64–> Apache: VC15
laragon\bin\apacheinto the corresponding folder (
httpd-2.4.38-win64-VC11). The unpacked files and folders may have to be moved to match the given folder structure (see