How to specify php version for specific project in Laravel on Windows 11
P粉033429162
P粉033429162 2023-12-23 19:56:22
0
1
524

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粉033429162
P粉033429162

reply all(1)
P粉458913655

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!