3

I have a Laravel 5.6 Project which is running with PHP Version 7.10 and another Laravel 7.x project with PHP version 7.4. I defined the PHP path in Windows 10 Environment Variable and every time I have to change the PHP Environment Variable to run each project.

any solution to prevent from this redundant work?

Mustafa Poya
  • 2,615
  • 5
  • 22
  • 36

2 Answers2

8

For Windows:

to run different projects with its required PHP version you can include the required PHP path before writing artisan serve:

C:\wamp64\bin\php\php7.0.33\php.exe artisan serve --host=127.0.0.1 --port=8000
C:\wamp64\bin\php\php7.4.9\php.exe artisan serve --host=127.0.0.1 --port=8500

For Linux (Ubuntu):

/usr/bin/php8.0 artisan serve --host=127.0.0.1 --port=8000
AnasSafi
  • 5,353
  • 1
  • 35
  • 38
Mustafa Poya
  • 2,615
  • 5
  • 22
  • 36
1

For Windows Xampp. you can set path like this. in my case xampp is in "C" drive.

/c/xampp/php/php.exe artisan serve
Waqas
  • 164
  • 3
  • 12