3

I've downloaded XAMPP ver. 7.2.10 which supposedly has the PHP ver. 7.2.10.

But when I run a composer update on cmd, it says that my PHP version is 7.0.21. I need to have a PHP 7.1.3 in order to run my frameworks.

Is there a way to change the PHP version without installing a new XAMPP? Because I already have the latest version installed and the PHP versions stated in the XAMPP and CMD are different.

K. Vante
  • 31
  • 1
  • 1
  • 3

5 Answers5

2

You can also do it in another way.

Download your desired version of php here and then go to XAMPP folder (most likely C:\xampp).

There, extract the downloaded php file and name it php (paste it in C:\xampp) Then, copy all files from your old php folder and paste it in the new php folder.

Do not replace any files, just copy missing files and if your php version is less than 7, don't forget to edit your httpd-xampp.conf file.

Restart your Apache server and, hopefully, it will work.

mazhar
  • 21
  • 2
1

Change you Xampserver you can't change php version inside xampserver

you can download from below link 

Download xampserver

Sanu0786
  • 571
  • 10
  • 15
0

Maybe you are using another version of php, check if you have another version installed and see environment variables and path there should tell you the php path used, or maybe you have an apache running, to stop it enter services and stop apache24.

Huito7
  • 1
0

Your Bash/Terminal runs in it's own PHP world. You can upgrade it with apt-get on XAMPP VM see here: https://die-schwarzwald-werbeagentur.zazudesign.de/internet-programmierung/a-working-typo3-9-4-x-composer-installation-on-xampp-osx-php7-2-imagemagick-mariadb.html

After upgrading PHP to 7.2 composer will work. For some reason composer uses the bash PHP-version and not the Apache2-PHP-Version

0

after you download your new version of php with apache, you will have two folders apacheVERSION and phpVERSION, just change the name of apacheVERSION to apache and the phpVERSION to php and restart apache in XAMPP.

Paviry Dev
  • 76
  • 3
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 26 '23 at 04:42