Home  >  Q&A  >  body text

How to specify php version for specific project in Laravel on Windows 11

Here I am developing a simple Laravel project that uses php version 7.1.3, and php version 8.1.2 is installed on my computer.

How to specify specific php versions for different projects?

I tried reinstalling php version 7.1 but I have other projects on my computer using version 8 or higher.

Can I specify a specific php version for different Laravel projects?

P粉033429162P粉033429162324 days ago573

reply all(1)I'll reply

  • P粉458913655

    P粉4589136552023-12-24 15:33:13

    Use Laragon

    I don't know if other stacks are possible, but Laragon is a lightweight and performant option.

    As described here It's easy and has very few steps.

    1. Install Laragon as a LAMPP or LEMMP stack for Windows
    2. Download the PHP version you want from the official website
    3. Extract the downloaded zip into the PHP folder in your Laragon installation.
    4. Right-click the Laragon icon in the system tray. Navigate to PHP and select your version!
    5. Restart Laragon and it's done!
    The default installation path is:

    C:\laragon\bin\php\

    Laragon will choose the folder name as the identifier.

    NOTE: You can configure apache or nginx to provide each directory with its own version, but it is not covered in this article. You should learn it from the official documentation.

    reply
    0
  • Cancelreply