Automated setup for Laragon portable without dependencies.
- Download or clone this repo
- Run
laragon.bat
- Open the installed laragon.exe in C:\laragon
- Install the preconfigured packages via laragon menu, Right click > Tools > Quick Add > All
- Using laragon menu, Click Menu > Apache > SSL > Enabled
- Using laragon menu, Click Menu > Apache > SSL > Add laragon.crt to Trust Store
- Finally run
settings.bat
for final setup
Everything is hard coded at the moment, and assumes the user is gonna use the default setup.
- Allow user to specify where to dump winrar, laragon portable and git portable, currently using C:\Users\Administrator\Downloads
- Allow user to specify a custom packages conf file to use, currently uses the hard coded packages_conf block
- Allow user to opt in using nginx instead of deleting it by default
- (When user uses custom packages.conf sublime won't be installed) Allow user to opt in for other text editor instead of assuming they would use sublime text
- Ask if user would like to use cmder_mini
- Test setting up Rails on Laragon (this was difficult than expected, no wonder laragon had a separate repo for rails setup)
- Prompt user to setup git username and email
- PHP 8.0.9
- Apache 2.4.48
- PHPMyAdmin 5.1.1
- MySQL 8.0.26
- Sublime 4 Portable build 4113
- Cmder mini 1.3.18
- Git Portable
- Download laragon portable, run and extract to
C:\laragon
- Update
C:\laragon\usr\packages.conf
and include the packages needed to install by laragon - Download all using laragon menu, Right click > Tools > Quick Add > All
- Download git portable and extract to
C:\laragon\bin\git
- Don't forget to set up
git config --global user.name
andgit config --global user.email
git config --global init.defaultBranch main
git branch -m master main
- Don't forget to set up
- Add sublime path to Environment PATH variable
- Select corresponding versions for PHP, Apache, MySQL
- This step is now moved as the final override step
Using laragon menu, Right click > Apache > SSL > Enabled and Add laragon.crt to Trust Store - Open
C:/laragon/bin/apache/httpd-2.4.48-o111k-x64-vs16/conf/httpd.conf
- Change
Define SRVROOT "/Apache24"
- To
Define SRVROOT "C:/laragon/bin/apache/httpd-2.4.48-o111k-x64-vs16"
- Change
- Open
C:/laragon/etc/apache2/httpd.ssl.conf
- Comment out
Listen 443
- Comment out
- Delete laragon/data/mysql-8
- cd to laragon/bin/mysql8.0.0.x/bin folder via cmder
- run
mysqld --initialize-insecure --console
to test run mysql -u root -p
and when it asks for password just hit enter since we already removed the password on step 3.
No need to do following steps steps since --initialize-insecure
initializes mysql user without a password
3. run
4. mysqld --initialize --console
(remember the password, important for step 6.)run
5. start mysqld
run
6. mysql -u root -p
put in the password from 6.
7. You are now in mysql shell and can remove the password again:
8. ALTER USER 'root'@'localhost' IDENTIFIED BY '';
run exit
and ctrl + c the spawned tab from step 4.
- cd
C:\laragon\bin\composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
- php composer-setup.php
composer global require laravel/installer
- Open C:\laragon\bin\laragon\tpl\openssql.conf
- Open C:\laragon\usr\tpl\openssql.conf.tpl
- Open C:\laragon\etc\ssl\openssql.conf
- Change keyUsage = keyEncipherment, dataEncipherment
- To keyUsage = nonRepudiation, digitalSignature, keyEncipherment
- Reload Apache - Laragon will generate new SAN certificate
- Click Menu > Apache > SSL > Add laragon.crt to Trust Store
Since cmder mini is installed already via laragon package that we had customized we can just rename it.
- Rename
C:\laragon\bin\cmder
to cmder.bak - Rename
C:\laragon\bin\cmdermini
to cmder - Copy the following from
C:\laragon\bin\cmder.bak\vendor\init.bat
:: Laragon Start -------------------------------------------------------------------
if exist "%CMDER_ROOT%\..\git" (
set "GIT_INSTALL_ROOT=%CMDER_ROOT%\..\git"
)
if exist "%GIT_INSTALL_ROOT%\post-install.bat" (
echo Running Git for Windows one time Post Install....
pushd "%GIT_INSTALL_ROOT%"
call "%GIT_INSTALL_ROOT%\git-bash.exe" --no-needs-console --hide --no-cd --command=post-install.bat
@DEL post-install.bat
popd
:: cd /d %USERPROFILE%
rem
)
for /f "delims=" %%i in ("%CMDER_ROOT%\..\..\usr") do set USER_DIR=%%~fi
set USR_DIR=%USER_DIR%
if exist "%CMDER_ROOT%\..\laragon\laragon.cmd" (
:: call Laragon own commands
call "%CMDER_ROOT%\..\laragon\laragon.cmd"
)
if exist "%USER_DIR%\user.cmd" (
rem create this file and place your own command in there
call "%USER_DIR%\user.cmd"
) else (
echo Creating user startup file: "%USER_DIR%\user.cmd"
(
echo :: use this file to run your own startup commands
echo :: use in front of the command to prevent printing the command
echo.
echo :: call %%GIT_INSTALL_ROOT%%/cmd/start-ssh-agent.cmd
echo :: set PATH=%%USER_DIR%%\bin\whatever;%%PATH%%
echo.
echo :: cmd /c start http://localhost
echo.
) > "%USER_DIR%\user.cmd"
:: cd /d "%CMDER_ROOT%\..\..\www"
rem
)
:: Laragon End -------------------------------------------------------------------
- Then insert it into
C:\laragon\bin\cmder\vendor\init.bat
after the following lines:
:: some code at the top...
:: Set home path
if not defined HOME set "HOME=%USERPROFILE%"
%print_debug% init.bat "Env Var - HOME=%HOME%"
:: paste it here
- This should make laragon detect the updated cmder mini we just installed, to test open
laragon.exe
and click on Terminal button.
- Error: webpack toast encountered an error Please make sure that the app id is set correctly.
- Solution: windows settings -> Notifications and Actions (on Windows 10)
- Source: https://stackoverflow.com/questions/64949275/npm-run-dev-not-compiling-assets-with-error-notifications-for-user-are-disabled