Here I’m working on a simple laravel project which uses php version of 7.1.3 and I have php version 8.1.2 installed on my computer.
How do I specify specific php version for different projects?
I tried to re-install php 7.1 version but I have other projects on my computer which uses 8 or higher.
Can I specify specific php version for different laravel projects?
2
Answers
I think Docker is the best solution for you, because it doesn’t matter which php version is installed on your computer. Here is some link for ‘Dockerizing’ your Laravel application. Hope this helps 🙂
Use Laragon
I don’t know if it is possible with other stacks but Laragon is a lightweight ans performant option.
As described here it’s easy and there are few steps.
LAMPP
orLEMMP
stack for windowsThe default installation path is:
Laragon will pick up the folder name as the identifier.
Note: You Can config
apache
ornginx
to serve each directory with its own version but it is not included in this post. you should learn it from official documentations.