Test Environment for OpenMage in Windows 10 Based on DDEV #3839
Replies: 6 comments 20 replies
-
Those who use PHPStorm as IDE can integrate DDEV in the editor.There is already a plugin that offers more features. For more details visit |
Beta Was this translation helpful? Give feedback.
-
Question on (Windows) Installing mkcert for Secured Connections scoop bucket add extras
scoop install mkcert I cannot connect my steps with this step:
Where do I look for the file [edit] Got it, the windows executable to install mkcert can be downloaded here: https://github.com/FiloSottile/mkcert/releases |
Beta Was this translation helpful? Give feedback.
-
I encountered the following error: kiat@DESKTOP-7GLIBDK:~/openmage$ ddev composer install
Building project images...
Project images built in 1s.
Container ddev-openmage-db Recreate
Container ddev-openmage-web Recreate
Container ddev-openmage-db Recreated
Container ddev-openmage-web Recreated
Container ddev-openmage-db Started
Container ddev-openmage-web Started
Failed to create certificates for project, check mkcert operation: ERROR: failed to read the CA certificate: unexpected content
; err=exit status 1 What do I do? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
For PHPMyAdmin, it can be invoked simply with |
Beta Was this translation helpful? Give feedback.
-
@addison74 can you add it to #4156 ? |
Beta Was this translation helpful? Give feedback.
-
IMPORTANT
If you run Windows OS in a virtual machine, it is mandatory to activate the virtualization option. For example, in VMware with the virtual machine off, access
Edit virtual machine settings
. In theHardware
tab selectProcessors
and in theVirtualization engine
section check theVirtualize Intel VT-x/EPT or AMD-V/RVI
option.You need at least 8 GB of memory to run (Docker + PHPStorm) decent. I recommend a machine with 16 GB.
(Windows) Installing the Windows Terminal Application
Microsoft Store
application and search forWindows Terminal
Get
buttonIf you use PHPStorm, at the bottom there is a tab called
Terminal
. Here you can run commands in the Linux distribution too.(Windows) Installing WSL2 (Windows Subsystem for Linux 2)
The Installation Tutorial
https://pureinfotech.com/install-windows-subsystem-linux-2-windows-10/
Useful Commands
https://learn.microsoft.com/en-us/windows/wsl/
Advanced Settings
https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configure-global-options-with-wslconfig
You can configure limits on the memory, CPU and swap size allocated to WSL 2 in a
.wslconfig
file. For example, create a file named.wslconfig
in theC:\Users\<User Name>
directory with the following content(Windows) Installing a Linux Distribution
Variant 1
Command Prompt
application as Administratorwsl --list --online
wsl --install -d Ubuntu-20.04
Variant 2
Microsoft Store
application and search for UbuntuOpen the
Terminal
application then choose a new tab with Ubuntu. Follow the steps to complete the installation, setting theusername
andpassword
(e.g. ubuntu / 1234).(Windows) Installing Docker
https://docs.docker.com/desktop/install/windows-install/
Docker Desktop Installer.exe
and run it as AdministratorUse WSL 2 instead of Hyper-V (recommended)
(Windows) Installing mkcert for Secured Connections
https://github.com/FiloSottile/mkcert
Terminal
application as Administratormkcert-vX.X.X-windows-amd64.exe
mkcert-vX.X.X-windows-amd64.exe --install
Yes
(Windows) Linux distribution drive mapping
Windows Explorer
applicationLinux
path and selectUbuntu-20.04
Map network drive...
from the menu. Choose a letter, for example Z:From now on it appears in the
This PC
section underNetwork locations
. If you want to disconnect it, right-click and selectDisconnect
from the menu.(Windows) PHPStorm
Create a new project in PHPStorm that has the location where you cloned the OpenMage repository. If you log in to your GitHub account, you will see in the
Pull Request
tab on the left the open PRs from OpenMage. Open one and checkout to start testing. When you are done, at the bottom of the PHPStorm window you will see theGit
tab. Click on it, then right click onLocal > main
and selectCheckout
. You can update the repositories, locals and remotes, from time to time and more.(Linux) Installing DDEV
https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/
Terminal
application and choose a new tab with Ubuntusudo apt update && sudo apt upgrade -y
(Linux) Copying mkcert Certificates from Windows to Linux
Variant 1
Terminal
application and choose a new tab with Ubuntumkdir -p /home/<user_name/.local/share/mkcert
cp /mnt/c/Users/<User Name>/AppData/Local/mkcert/* /home/<user_name>/.local//share/mkcert/
Variant 2
Windows Explorer
application as administratorrootCA.pem
androotCA-key.pem
fromC:\Users\<User Name>\AppData\Local\mkcert
/home/<user_name/.local/share/mkcert
mkcert
directory(Linux) Installing OpenMage
First make sure that the
Docker Desktop
application is running in Windows.Terminal
application and choose a new tab with Ubuntumkdir -p /home/<user_name>/openmage
git clone https://github.com/OpenMage/magento-lts.git /home/<user_name>/openmage
/home/<user_name>/openmage
.ddev/config.yaml
file to change the webserver and PHP version as you want. I am using Apache and PHP 8.3For more information about using DDEV please visit https://github.com/OpenMage/magento-lts/blob/main/docs/DDEV.md. It is a fantastic tool!
CONCLUSION
As you can see, the more complicated part is the initial configuration of WSL, Docker, DDEV. Once done, it doesn't take more than 3-5 minutes to get an instance of OpenMage ready for testing. Forget about XAMPP, WAMP in Windows.
You can use a test environment in Windows without WSL2, but I do not recommend this configuration because DDEV must be installed in Windows and not inside the Linux distribution. It depends on Mutagen and it is very very slow. Testing in a Linux distribution has many advantages and it is close to moving the project into production.
Beta Was this translation helpful? Give feedback.
All reactions