I have two xampp versions in my machine one have php version 5.4
and other having 7.1(recently installed.) I usually use composer command to download laravel. previously i get laravel version 5.0.X when i download because of my php vesrion(5.4)
but even after installing new xampp(having php version 7) composer is downloading laravel 5.0.x only. When i check my php version it is showing 5.4 now how can i choose or connect latest php version to composer so that i will get latest laravel version.
Asked
Active
Viewed 3,671 times
1

prudhvi259
- 547
- 2
- 9
- 31
-
XAMPP on what OS – RiggsFolly Jun 20 '17 at 10:07
-
The `composer` command is just a convenience script. I guess you can always type the full path of everything: `/full/path/to/php /full/path/to/composer.phar` and create custom scripts or aliases to the extent of your shell capacities. – Álvaro González Jun 20 '17 at 10:08
-
@RiggsFolly windows 10 – prudhvi259 Jun 20 '17 at 10:08
-
How have you got 2 XAMPP's installed on the same PC. They both have Apache listening on port 80 and MySQL listening on 3306. I would guess you only really have one installed and one that got overwritten – RiggsFolly Jun 20 '17 at 10:17
-
@RiggsFolly No, both have different ports for apache and mysql. Both servers running fine. – prudhvi259 Jun 20 '17 at 10:19
-
And different names for the Apache service and the MySQL service? – RiggsFolly Jun 20 '17 at 10:22
-
Have you checked your Windows PATH, might be that is set to the old version fodler structure. I believe XAMPP does set the PATH – RiggsFolly Jun 20 '17 at 10:22
-
You should install two separate composer instances, and set appropriate php.exe path for it. – degr Jun 20 '17 at 10:22
-
@RiggsFolly No different names but i changed port numbers and yes my windows PATH is set to old version now can i add new version and both can exist ? – prudhvi259 Jun 20 '17 at 10:31
-
I personally would remove all from the path, and write a littel batch file to run before doing and PHP CLI work to associate the specific PHP folder to the path that I want to use at this point in time. See [this answer I gave for WAMPServer](https://stackoverflow.com/questions/15597067/how-to-run-php-from-windows-command-line/16289254#16289254) for example. Which copes better with multiple versions for Apache/PHP/MySQL – RiggsFolly Jun 20 '17 at 11:17
2 Answers
2
Finally i found the solution. I changed my composer path to new php version and now getting what i want.

prudhvi259
- 547
- 2
- 9
- 31
-
2
-
there is another way https://laracasts.com/discuss/channels/laravel/change-composer-php-version-without-uninstalling-composer , worked for me – Jhon Jesus Nov 09 '21 at 05:12
0
I set my Environment variables as follow:
- change name of respective document xampp that contains your project I want to launch. my system context

lena
- 1