How to fix the issue of machine showing different version of php in php-cli and phpinfo ?
Recently I installed Xampp on my linuxmint pc and it came with php version 8.1.6 when I checked in phpmyinfo . But when I tried to check it in terminal it throws en error as "php" command not found and advised to install php-cli . So I installed the php-cli with sudo apt install php-cli command . Now after checking with php --version command it shows php version 7.4.3 (cli) and not 8.1.6 . So is there a way to configure the command line so that it shows the correct php version installed on my pc ?
@Sinnbeck okay but what about the php8.1 which is installed through xampp in my pc ? If I add this repository what would happen to my already installed php ? will there be any conflict ?
Using linux mint as main OS since five years now , fell in love the first time i used it .
@inayan Personally I would probably just install the repo so I can install php8.1 on my system. And if xampp gives you problems, then perhaps decide if its the best pick for the job. You can just let php install apache2 on your system and set that up (its just setting up one file).
Or you can even go the docker route that I have gone. I can set up a new project with a specific php version, and mysql version in a minute or two. I use something called Lando, to ease the setup process :) https://sinnbeck.dev/posts/using-lando-to-run-laravel-in-docker
@Sinnbeck Actually xampp works fine , I was just about to install composer and before doing it I wanted to check my php version and all these happenned . I am pretty sure if I install composer and laravel now it will just work as normal like it did earlier . But I just want to fix this for my own peace of mind and want to know why this happened . Anyway Thanks for your advice , I will see if I can get used to docker .
@inayan My guess is that xampp manages its own php versions separately from your local installs, so adding the PPA and installing php 8.1 manually wouldnt change anything for xampp (I would assume) :)