Hey, try Docker, and with Sail is quite easy to do this https://laravel.com/docs/9.x/sail
How to run php artisan serve with a specific php version ?
Hello,
I'd like to install PHP 8.x on my Ubuntu distribution but I want to continue using PHP 7.4 with some Laravel projects.
How is it possible to do that ? Is it for example possible to generate a virtual environment like with Python ? Or having PHP entirely inside the Laravel project instead of installed on the OS ?
Thanks for your help ;).
Vincent
@vincent15000 yeah with each service (php, mysql etc) in a seperate virtual machine. I personally prefer lando over sail. They do the same but slightly different https://sinnbeck.dev/posts/using-lando-to-run-laravel-in-docker
Anyways. You can also use the full path to php
/path/to/php8 artisan serve
Please or to participate in this conversation.