Solved - phpinfo() and php -v shows different version of PHP

By Hardik Savani | April 12, 2021 | Category : Ubuntu


In this tute, we will discuss phpinfo() and php shows different version of php. if you want to see example of php version different phpinfo then you are a right place. we will help you to give example of phpinfo showing different version. step by step explain php -v shows different version.

Few days ago i upgrade my php version 7.3 to 7.4 in ubuntu system. it's installed everything well with php 7.4 but when i try to rum "php -v" command then it still shows old version of php.

after google search i found solution how to resolve it. you have to run update-alternatives command choose current version from list.

Let's run bellow command:

sudo update-alternatives --config php

now there will be a list of installed php cli, choose what you want to keep. as like bellow screen shot:

now run bellow command to restart:

sudo service apache2 restart

I hope it can help you...



Tags : Ubuntu


Hardik Savani
My name is Hardik Savani. I'm a full-stack developer, entrepreneur and owner of Aatman Infotech. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap from the early stage.
Follow Me: Github Twitter
***Do you want me hire for your Project Work? Then Contact US.

We are Recommending you: