Laragon: PHP development environment, prepared in less than 2 minutes

Very easy, fast, automated Apache, MySQL, PHP environment (AMP) which can be installed and configured in light speed. Here is very quick tutorial how to do it!

In this case, we will install PHP developer environment and create test project to be ready to start write a first line of code.

Install Laragon

Download and install package Laragon Lite in my case, because there is very simple way to add another packages you need later. After install process simply run it and click to Start All button.

Change PHP version (optional)

Simply download another version of PHP and unpack archive to \laragon\bin\php\ folder. Then you can change PHP version by right click on Laragon tray icon and select PHP>Version. Wow! that was unbelievable simple.​​

Fine tune Preferences to auto-create virtual hosts

You can set Document root of Laragon where your projects are stored. After Laragon start or restart Apache server, Document root directory ( you can have more than one ) is scanned for new projects and Laragon will automaticaly create virtual host in Apache configuration and new row in Windows router file /etc/hosts 

In my case is default .test domain suffix changed to .local - domains will be created with {domain}.local address.

Let's create new project

Only thing you have to do is create a project folder in document root directory and restart Laragon Apache!

And that is it! You can start to develop your new project in your new folder. Laragon will  create and set virtual host and also new row in /hosts file!

Set custom project public directory

In my projects are application files separated from public directory. So you can tell Laragon to use specific directory as public by little change in /laragon/usr/laragon.ini. Just add this line to [preferences] section:

PublicDir=www

it will be detected as project start folder with index.php file for each new project.

Optional Settings

Persisten disable ONLY_FULL_GROUP_BY mode in MySQL

[mysqld]
sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Disable Laragon's Adminer

Remove or rename adminer.conf from {laragondir}/etc/apache2/alias/adminer.conf to disable default Laragon Adminer version. And restart Laragon services.

Enable OpenSSL module

Enabling openssl support can be difficult because sometimes you need to load additional DLLs to force APACHE to use it properly.

enable openssl extension in PHP.INI

extension=php_openssl.dll

and also load dll libraries in HTTPD.CONF (add these lines at end of the file)

LoadFile "c:/laragon/bin/php/php-7.1.30-Win32-VC14-x64/libeay32.dll"
LoadFile "c:/laragon/bin/php/php-7.1.30-Win32-VC14-x64/ssleay32.dll"
LoadFile "c:/laragon/bin/php/php-7.1.30-Win32-VC14-x64/php7ts.dll"
LoadFile "c:/laragon/bin/php/php-7.1.30-Win32-VC14-x64/libpq.dll"

Remember replace [php-7.1.30-Win32-VC14-x64] to specific PHP version folder you are using in Laravel.

And this is only beginning...

You can find more info on laragon.org

Thank you Leo Khoa - good job!