Linux serverlinux web serverNETWORK ADMINISTRATIONS

Developing on Windows with WSL2 (Subsystem for Linux) and PHP

Developing on Windows with WSL2 (Subsystem for Linux) and a PHP LAMP stack on wsl2. Adam Culp of Beachcasts PHP programming videos shares how to set up a local development environment with PHP on WSL 2, also known as Windows Subsystem for Linux, and installs a Laravel framework project for local development. By installing a full lamp stack on WSL 2. In this Laravel howto we will set up Apache, and PHP on Ubuntu using WSL, for an awesome WSL 2 local dev environment. I also show how to launch VS Code and Windows Explorer from within Ubuntu running inside WSL 2.

For information about doing this with Laravel Sail, see https://youtu.be/Zxi157MpoRE

Please * LIKE, COMMENT, AND SUBSCRIBE * – and share with others!

Key Topics:
– Creating a development environment using Ubuntu running on WSL 2
– Installing LAMP in WSL 2
– Creating a symbolic link to a working directory on a Windows host
– Setting up the userdir extension for Apache 2
– Install and configure a Laravel based application on Ubuntu within WSL 2
– Launching Windows-based tools from within WSL 2 via CLI

For a nice list of equipment I use in my studio, and to support the channel if you make any purchases (doesn’t cost you a thing), visit my kit at kit.co: https://kit.co/beachcasts/beachcasts-studio

Errata:
Let me know if you notice anything that should be errata

Associated Links:
https://php.net
https://laravel.com/
https://apache.org
https://code.visualstudio.com
https://docs.microsoft.com/en-us/windows/wsl/
https://beachcasts.com

Timeline:
00:00 Intro
01:25 Prerequisites for setting up a development environment in WSL 2
02:17 Installing Apache 2 on Ubuntu in WSL 2
02:55 Install PHP in WSL 2
04:21 Creating a working directory on Windows (host) to use within Ubuntu (WSL)
05:33 Add a symbolic link to the directory on the Windows host
08:13 Activate userdir extension for Apache 2
09:04 Configure the userdir extension
11:47 How to install Composer dependency manager for PHP globally
14:11 Installing the Dom extension (XML extension) for PHP, and unzip utility for Ubuntu
15:47 Creating a Laravel based application on Ubuntu within WSL
17:31 Notes about rendering speeds using WSL 2
18:57 Alternative methods for serving websites from WSL 2
19:55 Launching VS Code from within a WSL 2 environment over CLI
21:06 Launching Windows Explorer from within WSL 2 to view files on Windows host

Other Beachcasts videos you might find interesting:
WSL 2 with Docker Gettings Started and Docker Desktop Installation https://youtu.be/h0Lwtcje-Jo
Getting Started with WSL 2 and Ubuntu on Windows 10 https://youtu.be/X3bPWl9Z2D0
Conference Talk Preparation In 8 Steps for Programmers https://youtu.be/wRwKWKD38g0
How to understand code written by someone else https://youtu.be/lj6GH6yWSlk
Ways to advance your programming skills and improve as a developer https://youtu.be/X6abVw8SlZc
Make your local DEV environment available on the internet https://youtu.be/xs2o7B_Ex9E
AWS Elastic Load Balancer (ELB) Tutorial How-To https://youtu.be/Sr2Mq9Gegew
Laravel Model Factory Tutorial using Artisan make:model https://youtu.be/hM135dPJ1dM
Authentication in Laravel Tutorial https://youtu.be/2qJkzWJNpjQ
Top 5 skills to be a better software developer https://youtu.be/kbX8iATLqxs
Install Laravel in Docker container on Ubuntu for beginners https://youtu.be/0HTruhilvcU
Getters and Setters accessors in object-oriented programming https://youtu.be/cozignPaoLg
Critical programming issues preventing a PHP 7 upgrade https://youtu.be/z13glyDnm6s
Behat for beginners functional REST API testing tutorial https://youtu.be/nFNGDhyFrm4
Doctrine ORM one-to-many bi-directional association https://youtu.be/4nEdBDxBc1w
PHP Mess Detector static analysis to find PHP code smells https://youtu.be/8fEfHESrK5E
Doctrine ORM one-to-many self-referencing association https://youtu.be/4dHZ6cZooOk
10 reasons to become a consultant in a consulting business https://youtu.be/J7gpMYAKmDM
10 bad things about consulting https://youtu.be/ELE0G3e7h3c
How to get lines of code in PHP https://youtu.be/HpC-Cvxj6oY
Use UUID with Doctrine ORM for DB keys https://youtu.be/SYuLwMwSIpg
Make a Create handler middleware https://youtu.be/FIYh-VIWUko
Automate Hypermedia creation for PHP REST API https://youtu.be/dX6S-pJVUXI
Configure Doctrine ORM https://youtu.be/pFvh5ZNhdOQ
Configure PhpStorm for PHP development with Docker https://youtu.be/FQWL-JTZvf4
Create PHP development environment with docker https://youtu.be/2ESAi2vq-80

Help through referrals:
Thinking of buying a Tesla electric vehicle? Use this referral link to also get six months of free Supercharging for both of us. Thank you. https://www.tesla.com/referral/tanya21367

I use TubeBuddy to help me manage my YouTube channel. If you’re interested, click the following link to check it out. https://www.tubebuddy.com/beachcasts

#php #wsl2 #beachcasts

source

by Beachcasts Programming Videos

linux web server

25 thoughts on “Developing on Windows with WSL2 (Subsystem for Linux) and PHP

  • So you didn't do any additional settings but when you installed Apache you instantly got the test website at your localhost in Windows?

    What if I also have Apache installed in Windows and it is running as a service on localhost domain, what will happen then?

  • I am very new in php world and had lots of questions about it. But with this video i found answers to my questions. Thank you so much @Beachcasts.

  • I liked Your explanation method, video quality, your voice very understandable

  • For those experiencing "FORBIDDEN" issues, simply type "cd" to return to your user's initial home directory and then go back one folder using "cd ../". After that, execute the command "chmod +x youruser".

  • very clean lesson, I've been setting it up several times already, many thanks!

  • It's a good tutorial, but can you also enable or install xdebuger? I tried several time but I can't seems to make it work in VsCode

  • Hello! Thanks! I like Linux! I like PHP!

  • pretty good, except I'm trying to figure out how to "save" at minute 11. you sort of assumed people knew how to do that. google isn't being of much help either.

  • Thank you for the great information, very clear, very concise and very informative. I hope you have an amazing new year.

  • Dude, let met tell you you're just great

  • Hello! Great video! Can you make a tut on how to connect to the wsl instance using SSH ? I am trying to use Pycharm and i dont get dependencies. i read that i should connect the project trough ssh ….

  • this was not only informative and accurate but also enjoyable to watch! You sir could be a teacher!

  • When I navigate to my project it shows the index file as plain code, and doesn't run it

  • why do we create the projects on windows instead of inside the wsl directory?

  • when I go to localhost I cant access, it says ERR_CONNECTION_REFUSED , what can I be doing wrong?

Comments are closed.