Joshua's Docs - Laragon WAMP Tool - General Notes
Light

These are some of my assorted notes on using Laragon, an excellent, powerful, and easy-to-use WAMP tool.

Using Your Own Terminal

By default, Laragon ships with a special version of ConEmu / Cmder - the special part is a bunch of setup scripts that make sure the right variables are injected. This is what makes it so that you can quickly switch between versions of PHP and other programs, all from the Laragon UI, and the terminal magically knows which binary to execute.

If you want to use your own terminal, there is some specific setup that is required to make sure that the right variables get loaded.

🚨 WARNING: With any of these methods, your terminal will have stale versions in your PATH if you have recently changed versions from the Laragon right click menu without afterwards manually launching the built-in terminal via the GUI. See this thread for details.

  • If you want to the full experience of Cmder (the console emulator), as well as all the Laragon variables, you can call a single setup script to load Cmder and initialize everything:

    • File is at /laragon/bin/cmder/cmder.bat
    • You should call it with the directory you want to have it start with as open

      • E.g. C:\laragon\bin\cmder\cmder.bat %cd%
    • This actually calls /laragon/bin/cmder/vendor/init.bat, which is responsible for a lot

      • Loading user aliases
      • Checking that Laragon's main init stuff has ran
      • This also ends up calling laragon.cmd (see below)
  • If you just want to load Laragon's path variables, you can call the main path loader script, at /laragon/bin/laragon/laragon.cmd

    • There is another script which calls this one, as well loads user-configurable commands: /laragon/etc/cmder/laragon.cmd
    • Or, you can call the cmder.bat init file, to get all this plus Cmder (see above)
    • See warning above about stale path values after changing versions without clicking the launch terminal GUI button

Example: Using Windows Terminal

Here is an example, of how I've added Cmder, with all of Laragon's initializations, to my Windows Terminal via settings.json:

{
	"profiles": [
		{
			"name": "Cmder",
			"hidden": false,
			"commandline": "C:\\laragon\\bin\\cmder\\Cmder.bat %projects%",
			"icon": "λ"
		}
	]
}

Note: %projects% on my PC maps to my project directory - change this to be whatever directory you want to have open when you launch the terminal

To make it your default for Windows Terminal, use the defaultProfile setting. For example, sticking with the above example, I would use:

{
	"defaultProfile": "Cmder"
}

Switching Internal Versions

One of the features of Laragon is the ability to quickly switch between versions of internals (PHP, Apache, NodeJS), all from the quick menu. However, this doesn't always work as expected.

There is a separate CLI tool for switching Node versions - NVM (Windows, Mac / *nix) - that is more robust than Laragon's built-in solution, but requires a separate installation and setup. Also things like asdf.

If switching versions via Laragon's UI does not seem to be working, check the following things:

  • That you are checking the version in a new terminal after switching
  • That you are using the built-in ConEmu / Cmder terminal

    • If not, some special setup is required to support how Laragon alters the path and bootstraps itself - see my notes
  • That there is not multiple versions of the binary in your path that are conflicting

    • If so, and they are not ones that you placed there, it could be that Laragon's internal path string got corrupted. I recently had this happen, where it was not getting updated when it should have been, causing stale path values

      • /laragon/bin/laragon/laragon.cmd
      • The only way I was able to get this "unstuck" and re-generated was to open Laragon's built-in terminal
    • Try Menu -> Tools -> Path -> Remove Laragon from Path, and then Add Laragon to Path
Markdown Source Last Updated:
Wed Jun 16 2021 03:14:04 GMT+0000 (Coordinated Universal Time)
Markdown Source Created:
Sat Jun 12 2021 12:05:33 GMT+0000 (Coordinated Universal Time)
© 2021 Joshua Tzucker, Built with Gatsby
Feedback