Installing Shopware on WSL

As mentioned in a previous post, I recently upgraded to WSL2 on my laptop. WSL basically lets you run linux and windows at the same time – a fact which still somewhat blows my mind given the MS attitude towards linux back when I first started using Linux…

Anyways, the goal was get to a point where I could install Shopware and start playing around with it. Shopware’s docs point you towards using Docker to set up Shopware for development work, but I’ve not had great experiences with Docker in the past, didn’t think that I had the disk space to spare for that – and looking at Shopware’s “installation from scratch” it didn’t look too bad.

The first step was to make sure my linux set up included all the requirements. I’d chosen to install Ubuntu 20.04 under WSL2, so the main things I needed to was make sure I had the right versions of MySQL and PHP installed. PHP needed to be updated to 7.4, as Ubuntu had come with 7.2. A couple ‘apt’ commands and that’s taken care of, and then I had to tell Apache to use PHP 7.4 rather than 7.2 – and also had to update my Apache config as indicated in the documentation.

I also had to install Node and NPM, again just simple apt commands and then it was time to check out the Shopware code from github and try running the setup script.

This is where I ran into minor problems. I got the cryptic “could not find driver” error and it took a little googling to realize that my new version of PHP was missing a few modules, including the driver to connect to MySQL. I found that running ‘sudo apt install lamp-server^’ took care of a lot of these and some googling tracked down the other packages needed.