CItyTrader's avatar

Setting Up Laravel for Development

I use windows and I want to set up a laravel development environment. I tried working on another laravel app and on running composer update, I got an error that the app was developed with PHP 7.0 and I am running PHP 8.1. How do I fix these kinds of issues permanently

0 likes
7 replies
OussamaMater's avatar

You're windows so I'll assume you're using either Laragon or Xampp or one of these bundles, the good thing is they allow you to have multiple php versions where you can switch between them to match the project requirements.

Here is how to add php to both Laragon and Xampp

  1. For Xampp https://www.tldevtech.com/how-to-switch-php-version-in-xampp-on-windows-10/
  2. For Laragon https://medium.com/@oluwaseye/add-different-php-versions-to-your-laragon-installation-d2526db5c5f1
1 like
OussamaMater's avatar

@CItyTrader I highly recommend Linux, as this will help you become a better developer overall, you won't find it hard when it comes to deploying your app, or creating a CI/CD workflow, managing servers (sys adm) later on, and it's an in demand skill.

But if you're sticking with windows for a while I would go with Laragon just because it's easier to setup and switch versions and all (I personally did not work with none of them, I don't want to mislead you, I only got the chance to use them when configuring it for some strangers in workshop s and I found that Laragon is better).

OussamaMater's avatar

@Sinnbeck Ah yes I totally forgot windows had wsl, that's better than both Laragon/Xampp.

And a +1 for the Linux Mint one of the best distros I used, highly recommend it.

2 likes
OussamaMater's avatar

@CItyTrader if you are talking about setting the env in Linux yes of course, it is pretty straightforward.

You simply need to install PHP (and its extenstions), composer and a database, that is what you need for a local env.

This article will help you (it installs nginx as well, which you may want to play with because you will be using it to serve your application in production instead of the php's built-in web server that comes with Laravel):

PS: The same commands will work on and any debian based Linux distro (ubuntu, mint, etc..), you don't have to use the same distro to follow along.

If you are talking about windows, this is the latest tuto I found (he is using xampp in this case):

Best of luck!

Please or to participate in this conversation.