-
Notifications
You must be signed in to change notification settings - Fork 23
Installation Guide
This document outlines the steps I take to setup my environment on windows using WSL. This requires being on the windows 10 Creative update or greater. It is written for the Ubuntu version of WSL.
WSL 2 is not currently supported. It will technically work but several issues may require additional steps. See Discussion of Known issues with WSL2 for more information.
- Install WSL.
- Install Terminus and set up to use bash for windows (optional).
- Install Acrylic DNS Proxy.
- Open a bash instance in a terminal.
- Run
sudo visudo
. - Add
ALL ALL = (root) NOPASSWD: /usr/sbin/service
andusername ALL=(ALL) NOPASSWD: ALL
to sudoer config. - Run
sudo add-apt-repository ppa:ondrej/php
. - Run
sudo apt-get update && sudo apt-get upgrade
- Run
sudo apt-get install libnss3-tools jq xsel libssl-dev zip unzip pkg-config libmemcached11 libmemcachedutil2 imagemagick memcached redis-server
- Run
sudo apt-get install network-manager dnsmasq
- Run
sudo apt-get install nginx mysql-server php-fpm php-cli php-mysql php-sqlite3 php-intl php-zip php-xml php-curl php-mbstring php-redis php-pear php-dev
In Ubuntu systems running MySQL 5.7 (and later versions), the root MySQL user is set to authenticate using the auth_socket plugin by default rather than with a password. In order to use a password to connect to MySQL as root, you will need to switch its authentication method from auth_socket to mysql_native_password. To do this, open up the MySQL prompt from your terminal:
- Run
sudo usermod -d /var/lib/mysql/ mysql
- Run
sudo service mysql start
- Run
sudo mysql
- Run
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
in mysql. Be sure to change password to a strong password of your choosing. - Run
FLUSH PRIVILEGES;
in mysql. - Run
exit
- Run
sudo service mysql restart
- To test logging in as a normal user run
mysql -u root -p
and enter the password from step 4.
- Run
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
. - Run
sudo apt-get install nodejs
.
- Run
wget https://getcomposer.org/installer
. - Run
php installer
. - Run
sudo mv composer.phar /usr/local/bin/composer
.
- Run
composer global require valeryan/valet-wsl
.
- Run
vi ~/.bash_aliases
. - Add
export PATH=~/.config/composer/vendor/bin:$PATH
. - Run
source ~/.bashrc
.
- In Windows hit the windows key and search for Acrylic and find Edit Acrylic Host File.
- Add
127.0.0.1 *.test
to the bottom of the file and save. - Hit the windows key again and search for Stop Acrylic Service.
- Search again for Start Acrylic Service.
- Run
valet install
. - Browse to a Laravel project folder and run
valet link
. - To test, browse to folder.test.
- In WSL and in the project folder run
valet secure
.
- In Windows Explorer browse to C:/tools/valet/certs/ and double click the install_certs.cmd file. This will install any certs in the folder as trusted root certificates.
- Refresh your browser and see if HTTPS is enabled and valid. You may need to restart valet and your browser to get everything in sync.
- Follow my WSL Startup Gist
1 Run sudo crontab -e
.
*/5 * * * * php /mnt/c/username/Projects/folder/artisan schedule:run >> /dev/null 2>&1