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

КОМЕНТАРІ • 59

  • @tonyxhepaofficial
    @tonyxhepaofficial  Рік тому +7

    Setup Windows WSL for Laravel Development

  • @ismailaamassi
    @ismailaamassi Рік тому +53

    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

    • @aquicnpj
      @aquicnpj Рік тому +2

      god

    • @juanlpm56
      @juanlpm56 8 місяців тому

      thanks

    • @Cucharadadeinternet
      @Cucharadadeinternet 7 місяців тому

      THANK YOU

    • @robertopaes2772
      @robertopaes2772 Місяць тому

      remember to: sudo dpkg -l | grep php | tee packages.txt
      sudo add-apt-repository ppa:ondrej/php before these php commands

  • @rosolovsky
    @rosolovsky Рік тому +14

    You forgot to add the following line:
    export PATH="$HOME/.config/composer/vendor/bin:$PATH"
    to your .zshrc file.

  • @CharlesDv
    @CharlesDv 3 місяці тому

    Thanks for the video. For me this is the correct way to develop in a Windows environment.

  • @waheed1987
    @waheed1987 Рік тому +2

    Thank you very much 🙂

  • @midteknologi
    @midteknologi Рік тому +2

    I am curious why not just install docker and run Laravel sail? instead install all manually?

  • @lesssass4478
    @lesssass4478 Рік тому +1

    You already done a tutorial, How to setup laravel sail with WSL, can you show how to the setup to laravel sail from here?

  • @dreamcode869
    @dreamcode869 Рік тому

    Thanks so much. Can you please make a video on deploying Laravel websockets

  • @jake221
    @jake221 Рік тому +2

    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 😊

    • @bogde
      @bogde 11 місяців тому

      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.

  • @genesesabarcar7913
    @genesesabarcar7913 3 місяці тому +1

    Is it possible to integrate WSL terminal with Laravel Herd?

  • @mohamadouabdoulbagui3227
    @mohamadouabdoulbagui3227 Місяць тому +1

    What's the search modal on 4:53 and how to get that ??

    • @aspirinemaga
      @aspirinemaga Місяць тому

      I guess it`s a powertoys addon: PowerToys Run utility

  • @personal1872
    @personal1872 2 місяці тому

    Can you please create a video for Laravel Valet (Linux) in WSL2 ?

  • @milenkostadinov8702
    @milenkostadinov8702 6 місяців тому

    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? ;) )

    • @tonyxhepaofficial
      @tonyxhepaofficial  6 місяців тому

      thats is a good idea. I work with Mac OS just wanted to show also for windows users how to have prompts.

  • @Ciphrassauroputu
    @Ciphrassauroputu 6 місяців тому +2

    2:14 sudo apt install build-essential curl file git git-core

  • @mahdiaghamohammadi7872
    @mahdiaghamohammadi7872 10 місяців тому

    thank you

  • @bunyaminbilenkaratas
    @bunyaminbilenkaratas Рік тому

    Are you senior ? and backend or fullstack ?

  • @javilerma89
    @javilerma89 Рік тому +1

    I get this error with "laravel new": laravel: command not found

    • @tonyxhepaofficial
      @tonyxhepaofficial  Рік тому +3

      add this to zshrc: export PATH="$HOME/.config/composer/vendor/bin:$PATH"

    • @codernerd7076
      @codernerd7076 11 місяців тому

      @@tonyxhepaofficial how do I do this?! Where is my zshrc file?! I got the same issue

    • @tonypetroski216
      @tonypetroski216 11 місяців тому

      @@tonyxhepaofficial i've added this line to .zshrc as "export PATH="$HOME/.config/composer/vendor/bin:$PATH"" but same issue. Laravel not recognized

    • @tonypetroski216
      @tonypetroski216 11 місяців тому +2

      Sorry my mistake. It does work, i just had to close & startup new Ubuntu

  • @fredinfunez4781
    @fredinfunez4781 4 місяці тому

    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

    • @tonyxhepaofficial
      @tonyxhepaofficial  4 місяці тому +1

      now you can use Herd on Windows

    • @fredinfunez4781
      @fredinfunez4781 4 місяці тому

      @@tonyxhepaofficial I know of Herd but I wanted to use Ubuntu 🥲 nvm I'll continue with Herd

    • @tamnd_vn
      @tamnd_vn 3 місяці тому

      @@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!

  • @lesssass4478
    @lesssass4478 Рік тому

    how to install Tableplus in ubuntu 22.04?

  • @einnlleinhatt_
    @einnlleinhatt_ 10 місяців тому

    Btw how to run the application without artisan serve ?

    • @karlson2804
      @karlson2804 6 місяців тому

      install docker and after make nginx or apache server docker-container

  • @DeepFul_Kay
    @DeepFul_Kay 2 місяці тому

    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)

  • @rosolovsky
    @rosolovsky Рік тому +1

    Apache ??? Why not Nginx?

  • @shahedahmed2599
    @shahedahmed2599 Рік тому

    😊

  • @ellmatic
    @ellmatic Рік тому

    "Set up"* - "setup" is a noun.

  • @anmasa
    @anmasa Рік тому

    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

    • @tonyxhepaofficial
      @tonyxhepaofficial  Рік тому

      What laravel installer you using??

    • @anmasa
      @anmasa Рік тому

      @@tonyxhepaofficial ➜ ~ laravel --version
      Laravel Installer 4.2.8

    • @anmasa
      @anmasa Рік тому

      Cuando creo un proyecto:
      $ php artisan --version
      Laravel Framework 10.18.0

  • @iordanistsapanidis4021
    @iordanistsapanidis4021 Рік тому

    κανενα advanced laravel???

  • @lesssass4478
    @lesssass4478 11 місяців тому

    Can anyone explain how to initialize a remote repository on the GitHub?

  • @lesssass4478
    @lesssass4478 Рік тому

    sudo add-apt-repository -y ppa:ordrej/php
    I am getting error in this stage.

  • @Ciphrassauroputu
    @Ciphrassauroputu 6 місяців тому

    6:27 sudo add-apt-repository -y ppa:ondrej/php

  • @CodeWithAbirOfficial
    @CodeWithAbirOfficial Рік тому +1

    8:05 what is the shortcut for this menu?

    • @maulx
      @maulx Рік тому +2

      alt+space, but you can only use it if youre installing powertoys

    • @tonyxhepaofficial
      @tonyxhepaofficial  Рік тому +1

      Alt+Space Powertoys app