Setup Windows WSL for Laravel Development
Вставка
- Опубліковано 4 жов 2024
- In this video, I will guide you through the following steps:
How to enable WSL on Windows and install a Linux distribution of your choice (I will use Ubuntu 20.04 in this example).
How to update and upgrade your Linux system and install the required dependencies for Laravel, such as PHP, Composer, MySQL, and Apache.
How to create a new Laravel project using Composer and configure it to work with WSL.
How to access your Laravel project from your Windows browser and test its functionality.
By the end of this video, you will have a fully functional Laravel project running on WSL that you can use for your own development purposes. You will also learn some tips and tricks on how to optimize your workflow with WSL and Laravel.
If you’re ready to get started, let’s begin!
Don’t forget to like, share, and subscribe to my channel for more Laravel tutorials. Also, feel free to leave a comment below if you have any questions or feedback. Thank you for watching! 😊
CloudWays Promo Code: CWT20
Promo Discount: 20% off for three months
Promo Link: bit.ly/cloudwa...
Hostinger: hostinger.com?REFERRALCODE=1TONY30
DigitalOqean $200 free: m.do.co/c/35b7...
Follow me:
Twitter: / codewith_tony
Facebook Page: / codewithtony
Instagram: / codewithtonyofficial
GitHub: github.com/cod...
Github Repo: github.com/cod...
Playlists:
Laravel Splade Tutorial: bit.ly/3j0IfTW
Laravel Filament Permission: bit.ly/3Gojd8Z
Vue Authentication: bit.ly/3g7YZHd
Laravel Inertia Portfolio - bit.ly/3DlxTp5
Laravel Reddit clone - bit.ly/3UOYS2O
React tutorial for beginners - bit.ly/3arkqjX
Laravel Filament Blog - bit.ly/3nWYv74
Laravel 9 Full Tutorial - bit.ly/3nTiyTR
Laravel 9 Media Library - bit.ly/3LpJmVr
Laravel Essentials Full Tutorial - bit.ly/3vplyuC
Laravel Mail Tutorial - bit.ly/37mJUNh
Laravel Restaurant Reservation - bit.ly/3Jc5IcG
Spatie Laravel Permission - bit.ly/3pOsOhN
Laravel Testing For Beginners - bit.ly/3t1gNq4
Laravel Roles and Permissions - bit.ly/3gOhM7d
LARAVEL INERTIA MOVIE APP - bit.ly/3FVMp4Q
Laravel Livewire Movie App - bit.ly/3s8D6v1
Laravel Classified Website - bit.ly/3nsFRnb
Livewire Employees - bit.ly/2ZtIpZY
Laravel Employees Management - bit.ly/3Gglt14
Laravel admin panel - bit.ly/3CcX75M
#laravel #windows #development #wsl
Setup Windows WSL for Laravel Development
7:09 sudo apt install php8.2 php8.2-cli php8.2-common php8.2-curl php8.2-pgsql php8.2-fpm php8.2-gd php8.2-imap php8.2-intl php8.2-mbstring php8.2-mysql php8.2-opcache php8.2-soap php8.2-xml php8.2-zip
god
thanks
THANK YOU
remember to: sudo dpkg -l | grep php | tee packages.txt
sudo add-apt-repository ppa:ondrej/php before these php commands
You forgot to add the following line:
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
to your .zshrc file.
Thank you so much
Thank you very much!!!!.
Thanks for the video. For me this is the correct way to develop in a Windows environment.
Thank you very much 🙂
You're welcome 😊
I am curious why not just install docker and run Laravel sail? instead install all manually?
@@codernerd7076 oh okey Thanks
You already done a tutorial, How to setup laravel sail with WSL, can you show how to the setup to laravel sail from here?
Thanks so much. Can you please make a video on deploying Laravel websockets
Great tutorial! Works like a charm. However, I have one issue I was wondering if anyone could help with. When I run “php artisan storage:link” it doesn’t work at all for local public images. Anyone have a fix for it?
Thanks 😊
probably late but for other people that may have the same issue: check if the link was actually created and if it's indeed a symlink. sometimes you just have a regular file there, not a link, and it doesn't work and php artisan storage:link doesn't actually fixes it either, it just says it's already there.
Is it possible to integrate WSL terminal with Laravel Herd?
What's the search modal on 4:53 and how to get that ??
I guess it`s a powertoys addon: PowerToys Run utility
Can you please create a video for Laravel Valet (Linux) in WSL2 ?
Hey Tony, ,a little question I got about setting up the Laravel Prompts on Windows.
From your video (thank you for which) you literally setup a new server under Windows WSL where you've installed all Laravel project requirements inside.
I was wondering why don't you instead install the dependencies under Windows and make the WSL find composer, NPM, Laravel installer etc. via env path instead? This way we can have any local Windows Server like XAMP, AMPPS, Laragon etc. while still having the benefit of Prompts which come native for Linux and MacOS but Microsoft forgot to add them out of WSL.
Also, my current server allows me to emulate any domain locally using windows hosts file so it makes my work locally and host wise matching in terms of configuration and allows an easy import later on when I need to deploy to my PROD host. With WSL you have to run multiple project folders if you have to work on some in parallels and go to each folder to use php artisan serve and then work on it. I agree it is perfect if we use a single project, however while running multiple projects like yourself and other freelancers would/could need to do, then this might be harsh, no?
What is your Professional feeling about using WSL over native apps/servers as well as would you still continue using WSL + LAMP when the new Server comes for Windows as well (Laravel Herd) this month?
Anyway, thanks for the video as it is my first time I made the prompts work as many people show in their demo videos and I was crushing my head how come it does not work on Windows until I've read the manual (rtfm, right? ;) )
thats is a good idea. I work with Mac OS just wanted to show also for windows users how to have prompts.
2:14 sudo apt install build-essential curl file git git-core
thank you
You're welcome
Are you senior ? and backend or fullstack ?
I get this error with "laravel new": laravel: command not found
add this to zshrc: export PATH="$HOME/.config/composer/vendor/bin:$PATH"
@@tonyxhepaofficial how do I do this?! Where is my zshrc file?! I got the same issue
@@tonyxhepaofficial i've added this line to .zshrc as "export PATH="$HOME/.config/composer/vendor/bin:$PATH"" but same issue. Laravel not recognized
Sorry my mistake. It does work, i just had to close & startup new Ubuntu
I followed the instructions but, it says command not found: laravel
That was the only command I had problems with, everything else was fine like in the video. Last message in the ubuntu command line was:
Using version ^5.8 for laravel/installer
now you can use Herd on Windows
@@tonyxhepaofficial I know of Herd but I wanted to use Ubuntu 🥲 nvm I'll continue with Herd
@@fredinfunez4781 1) type: vi ~/.zshrc
2) paste this: export PATH="$HOME/.config/composer/vendor/bin:$PATH"
3) save and quit: :wq
4) restart ubuntu and type 'laravel new'. Now it will work!
how to install Tableplus in ubuntu 22.04?
Btw how to run the application without artisan serve ?
install docker and after make nginx or apache server docker-container
im getting this SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (Connection: mysql, SQL: select * from `sessions` where `id` = fiSj6w862G4k5HqjdUeE8aZ6yu2sLdtmnBh79mVx limit 1)
Apache ??? Why not Nginx?
Nginx better
😊
"Set up"* - "setup" is a noun.
Hola, comentar que he tenido problemas a la hora de crear una nueva aplicación no lo reconoce:
➜ ~ cd Code
➜ Code laravel new
Not enough arguments (missing: "name").
Me pide que ponga un nombre.
Un saludo, un tutorial muy bueno, gracias por tu tiempo, saludos
What laravel installer you using??
@@tonyxhepaofficial ➜ ~ laravel --version
Laravel Installer 4.2.8
Cuando creo un proyecto:
$ php artisan --version
Laravel Framework 10.18.0
κανενα advanced laravel???
Can anyone explain how to initialize a remote repository on the GitHub?
sudo add-apt-repository -y ppa:ordrej/php
I am getting error in this stage.
What error
@@tonyxhepaofficial I fixed this by applying the command without -y
6:27 sudo add-apt-repository -y ppa:ondrej/php
8:05 what is the shortcut for this menu?
alt+space, but you can only use it if youre installing powertoys
Alt+Space Powertoys app